Select a database. After the database is selected, you can still use the data tables in other databases. You only need to specify database. data table.
Use db_name
Select * From db_name.tbl_name Show all databases Mysql> select Schema_name from orders; + -------------------- + | Schema_name | + ------------------ + | information_schema | Feng | MySQL | + ------------------------ + 3 rows in SET (0.11 Sec) Display tables of the database Feng Mysql> select table_name from information_schema.tables where table_schema = 'feng'; + ------------ + | table_name | + ------------ + | Feng | + ------------ + 1 row in SET (0.05 Sec) Database creation Create Database db_namecreate database db_name if not exists db_namecreate database db_name If not exists db_name Character Set utf8 Collate utf8_icelandic_ci Show create database db_name \ G Delete Database Drop database db_nameddrop database db_name if not exists db_name Database Modification Alter database db_name default Character Set utf8 default collate utf8_general_ci