Reply to comment
How display database tables in MySQL?
Submitted by Richard on Wed, 10/14/2009 - 06:13Switch to a database you want to use using this command:
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
Once you have selected the database, just type this command to show all the tables inside it.
mysql> show tables;
The database tables are shown below.
+---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 23 rows in set (0.00 sec)
If you are searching for a specific tables and you don't remember its exact name, you can use this command:
mysql> show tables in mysql like '%ser';
The result will display the table user because we search for a table which ends in "ser".
+------------------------+ | Tables_in_mysql (%ser) | +------------------------+ | user | +------------------------+ 1 row in set (0.00 sec)
Cheers!!!





Subscribe to Comments