Introduction to PostgreSQL for MySQL Users: Difference between revisions

Jump to navigation Jump to search
→‎listing all tables: add Change the password of a user
add more sections
→‎listing all tables: add Change the password of a user
 
(One intermediate revision by the same user not shown)
Line 60: Line 60:


After selecting a DB you can go ahead and execute SQL commands.
After selecting a DB you can go ahead and execute SQL commands.
== listing all tables ==
You can list tables in a DB.
MySQL:
<syntaxhighlight lang="mysql">
mysql> show tables;
</syntaxhighlight>
PostgreSQL:
<syntaxhighlight lang="psql">
postgres=# \dt
</syntaxhighlight>
== Change the password of a user ==
You can list tables in a DB.
MySQL:
<syntaxhighlight lang="mysql">
mysql> set password for 'dbuser'@'localhost' = password('newpassword');
</syntaxhighlight>
PostgreSQL:
<syntaxhighlight lang="psql">
postgres=# alter user "dbuser" with password 'newpassword';
</syntaxhighlight>


== Exiting from DB ==
== Exiting from DB ==


Ctrl-D should exit from both.
Ctrl-D should exit from both.

Navigation menu