After connecting to the MySQL server, you need to select a specific database to work on. This is because there may be more than one database available on the MySQL server.
Use command format:
Use < database name >;
If we want to switch to test database, we can use the following command:
mysql> use test;
Database changed
Now that we have selected the test database, all subsequent actions will be performed on the test database.
Note: All the database names, table names, and field names in the table are case-sensitive. So we have to use the proper name for any SQL command given.
In addition, the use command can end without a semicolon. Of course, if you take a semicolon, it does not affect. As follows:
mysql> Use test
Database changed
Mysql>
But if you want to break this command into two lines, it's not going to work, as shown here:
Mysql> use
ERROR:
Use must is followed by a database name
Some netizens may ask how to exit after the connection. In fact, do not have to quit, use the database, using show databases can query all databases, if you want to jump to other databases, with
Use other database names
It's OK.
The above is the MySQL use command of the detailed, follow-up to continue to supplement the relevant information, thank you for your support of this site!