Home>Article>Database> What is the command to view the database?

What is the command to view the database?

王林
王林 Original
2020-07-17 09:34:49 19557browse

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.

What is the command to view the database?

To view the database, you can use theshow databasescommand. 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn