JAEN

SQL

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
Attempt a connection and read the exact errorrefused=not listening/FW, timeout=path, auth=credentials.
See the whole flow →

Related commands

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