MySQL has many basic commands, and the show command is also one of them. In many users, the use of the show command is also prone to confusion,
This article brings together the many usage of the show command.
1. show tables or show tables from database_name; -- displays the names of all tables in the current database.
2. show databases; -- display the names of all databases in mysql.
3. show columns from table_name from database_name; or show columns from database_name.table_name; -- display the column name in the table.
4. show grants for user_name; -- displays the permissions of a user. The result is similar to the grant command.
5. show index from table_name; -- displays the table index.
6. show status; -- displays information about specific system resources, such as the number of running threads.
7. show variables; -- display the name and value of the system variable.
8. show processlist; -- display all processes running in the system, that is, the query being executed. Most users can view their own processes, but if they have the process permission, they can view all processes, including passwords.
9. show table status; -- displays information about each table in the currently used or specified database. The information includes the table type and the latest update time of the table.
10. show privileges; -- display different permissions supported by the server.
11. show create database database_name; -- displays whether the create database statement can create a specified database.
12. show create table table_name; -- displays whether the create database statement can create a specified database.
13. show engines; -- display available storage engines and default engines after installation.
14. show innodb status; -- displays the innoDB Storage engine status.
15. show logs; -- displays the logs of the BDB storage engine.
16. show warnings; -- displays errors, warnings, and notifications generated by the last executed statement.
17. show errors; -- displays only the errors generated by the last statement.
18. show [storage] engines; -- display available storage engines and default engines after installation. All databases whose names end with the 'T' character will be listed
View the currently used database: select database ();