Tuesday, October 26, 2010

MySQL quickest way to look at databases

Looking for MySQL's administration tool is a task. Installing and configuring PHPMyAdmin would take Apache, php and then successful configuration. Then what to do to look at the tables, databases in the fastest possible way to look at tables and execute queries.
$ mysql -u username -p
the command will prompt for a password
mysql> Show databases;
mysql> show tables;
 The above two commands are extremely useful when one wants to look at the databases installed and tables in individual databases.


For example to look at users tables in database drupal the following commands will suffice.

mysql> use  drupal6;
mysql> select * from users;

These commands can be used in both Linux and Windows and are very handy and dont require much to do.

No comments: