From MySQL to Postgres - Useful commands

This article shows a list of basic commands on MySQL and their corresponding versions for PostgreSQL. Connecting to a database MySQL $ mysql -u root -p Postgres $ su pgsql $ psql Or using a different user: $ psql dbname If you can’t connect because you don’t know what databases are available, try any of these: psql -l psql postgres psql template1 The postgres database is a default database meant for use by users, utilities and third party applications read more.