msyql show command summary

  • 2020-05-19 06:05:47
  • OfStack

There are many basic commands in MySQL, and show is also one of them. It is easy to confuse the use of show among many users.
This article brings together many USES of the show command.
1. show tables or show tables from database_name; -- displays the names of all the tables in the current database.
2. show databases; -- displays the names of all databases in mysql.
3. show columns from table_name from database_name; show columns from database_name. table_name; -- displays the column names in the table.
4. show grants for user_name; -- displays the permissions of one user, and the result is similar to the grant command.
5. show index from table_name; -- displays the index of the table.
6. show status; Displays information about system-specific resources, such as the number of threads running.
7. show variables; -- displays the names and values of system variables.
8. show processlist; -- displays all processes that are running on the system, that is, the queries that are currently executing. Most users can see their own processes, but if they have process permissions, they can see everyone's processes, including passwords.
9. show table status; -- displays information about each table in database that is currently in use or specified. The information includes the table type and the latest update time of the table.
10. show privileges; -- displays the different permissions supported by the server.
11. show create database database_name; -- shows whether the create database statement can create the specified database.
12. show create table table_name; -- shows whether the create database statement can create the specified database.
13. show engines; Displays the storage engine and the default engine available after installation.
14. show innodb status; -- displays the status of the innoDB storage engine.
15. show logs; -- shows logs for the BDB storage engine.
16. show warnings; -- displays errors, warnings, and notifications generated by the last statement executed.
17. show errors; -- shows only the error generated by the last execution statement.
18. show [storage] engines; Displays the available storage engine and the default engine after installation. All databases with the 't' character at the end of the database name will be listed
View the database currently in use: select database();


Related articles: