Connection Commands
This section covers essential commands for connecting to and managing ClickHouse Cloud connections.
Connection Information
Check Current Connection
SELECT currentUser() AS current_user,
currentDatabase() AS current_database,
currentQueryId() AS query_id;
View Connection Settings
Session Management
View Active Sessions
SELECT user,
client_hostname,
client_name,
client_version,
query_start_time,
query
FROM system.processes
ORDER BY query_start_time DESC;
Kill a Specific Query
Connection Pool Information
Check Connection Pool Status
Security and Authentication
View User Privileges
Check Access Rights
Troubleshooting Tips
Common Connection Issues
- Connection Timeout
- Connection Limits
Best Practices
- Always use secure connections (SSL/TLS) in production
- Set appropriate timeouts for your use case
- Monitor connection pools for potential issues
- Use connection pooling when appropriate
Connection String Examples
# Basic connection string
clickhouse-client --host=<host> --port=9440 --secure --user=<user> --password=<password>
# Connection with specific database
clickhouse-client --host=<host> --port=9440 --secure --database=<database> --user=<user> --password=<password>