Connect (psql/mysql/sqlcmd)
SafeConnect to a DB
psql -h <host> -U <user> -d <db>
Connect with common DB clients (psql/mysql/sqlcmd).
Examples
mysql -h db01 -u app -pConnect to MySQL
Syntax
psql -h <host> -U <user> -d <db> | mysql -h <host> -u <user> -p | sqlcmd -S <host> -U <user>
Before you run it
Connect only.
Used when you see
Can't connect to the database
2
See the whole flow →Attempt a connection and read the exact errorrefused=not listening/FW, timeout=path, auth=credentials.
Related commands
- Show running queriesShow running queries
- SELECTRead data
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store