basic commands of CLI of MySQL and PostgreSQL
I usually get confused for those commands. It's my own memo. thead tr, tbody tr:not(:last-child) { border-bottom: solid 1px gray; } thead th, tbody...
I usually get confused for those commands. It’s my own memo.
| | MySQL | PostgreSQL |
|-+-------+------------|
| login | mysql -h <hostname>
-u <username>
—password=<password>
<dbname> | PGPASSWORD=<password> psql
-h <hostname>
-U <username>
-d <dbname> |
| list databases | show databases; | \l |
| set current database | use <dbname>; | N/A |
| show table names | show tables; | \dt |
| show table schema | desc <tablename>; | \d <tablename> |