How to query all tables in the mysql database: 1. Execute the "mysql -u root -p" command and enter the password to log in to the mysql database server; 2. Execute the "USE database name;" command to switch to the specified Database; 3. Execute the "show tables;" or "SHOW FULL TABLES;" command to list all tables in the mysql database in table form.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In mysql, you can use the SHOW TABLES statement to query all tables in the database; this statement lists all tables in the MySQL database.
Query steps:
1. Execute the following command to log in to the mysql database server
mysql -u root -p
2. Switch to the specified database (mydb):
USE mydb;
3. List all tables in the mydb database:
show tables;
You can see that there are 4 tables in the mydb database: contacts, mip_demo, tb_dept, users
The SHOW TABLES command can display the tables Base table or view. To include the table type in the results, use the SHOW FULL TABLES
statement as shown below -
[Related recommendations: mysql video tutorial 】
The above is the detailed content of How to query all tables in mysql. For more information, please follow other related articles on the PHP Chinese website!