Home > Database > Mysql Tutorial > body text

What is the command to view the database?

王林
Release: 2020-07-17 09:34:49
Original
19580 people have browsed it

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 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
Copy after login
Copy after login

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
Copy after login
Copy after login

Can be

select schema_name from schemata\G
Copy after login

If you want to view the tables in the database, you can use the command

show tables
Copy after login

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';
Copy after login

If you want to view the table structure, you can use the command

desc  table_name;
Copy after login

If you want to view the table status, you can use the command

show table status from db like 条件
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!