The command to view the database is: [show databases]. This command can view all databases. If we want to view the tables in the database, we can use the command [show tables]. If you enter an incorrect command, you can use [\c] to end it.
To view the database, you can use the show databases
command. This command can view all databases and is equivalent to the following command
(Recommended tutorial: mysql tutorial)
select schema_name from information_schema.schemata\G
Related introduction:
Use the use command to select a database such as use information_schema. When using this command
select schema_name from information_schema.schemata\G
Can be
select schema_name from schemata\G
If you want to view the tables in the database, you can use the command
show tables
You can also view it in information_schema. The show command is a short mode that is convenient to use.
select table_name from tables where table_schema='jblog';
If you want to view the table structure, you can use the command
desc table_name;
If you want to view the table status, you can use the command
show table status from db like 条件
Tips: When entering multiple lines of commands, an error is found. , can be ended with \c.
The above is the detailed content of What is the command to view the database?. For more information, please follow other related articles on the PHP Chinese website!