Home >Database >Mysql Tutorial >How to query the database name in mysql
Mysql method of querying the database name: 1. Use the "show databases;" statement to query the database name; 2. Use the status statement to query, such as "currrent database:***", where *** is the current The name of the database where it is located.
The operating environment of this article: Windows 7 system, mysql version 5.6, Dell G3 computer.
mysql How to query the database name?
You can use these two methods to view the database name:
1. Use the show databases; statement;
2. Use the status statement to see the query results. One line is current database:***. Here *** is the name of the current database.
1. Open the mysql console and enter the password;
2. To enter the database, you must first enter show databases;
3. To use which database, you must first enter the use table name, such as use nowasp;
4. To know which tables are in this database Just enter the command show the database in step 3. Such as show nowasp;
5. After that, you can use a large number of sql statements to operate the tables you need to achieve the purpose of learning sql statements, such as viewing the data in the table select * from accounts;
Recommended study: "mysql video tutorial"
The above is the detailed content of How to query the database name in mysql. For more information, please follow other related articles on the PHP Chinese website!