Mysql use command select database details, mysqluse
After connecting to the MySQL server, you need to select a specific database to work. This is because multiple databases may be used on the MySQL server.
Use command format:
Use <Database Name>;
To switch to the test database, run the following command:
Mysql> USE test;
Database changed
Now we have selected the test database, and all subsequent operations will be performed on the test database.
Note: All Database names, table names, and field names in the table are case sensitive. Therefore, we must use an appropriate name for any given SQL command.
In addition, the use command can end without a semicolon. Of course, if a semicolon is included, it will not be affected. As follows:
Mysql> use test
Database changed
Mysql>
However, if you want to split the command into two lines, the command will not work, as shown below:
Mysql> use
ERROR:
USE must be followed by a database name
Some netizens may ask how to exit after the connection. In fact, you don't need to exit. After using the database, you can use show databases to query all databases. If you want to jump to another database, use
Use other database names
You can.
The above is a detailed explanation of the mysql use command. We will continue to add relevant information in the future. Thank you for your support for this site!