Home > Article > Daily Programming > What is the command to select database in mysql
Use the USE command in MySQL to select the database to be operated. The syntax is: USE database_name. The steps are as follows: 1. Use the mysql command to connect to the server; 2. Enter USE database_name and replace database_name with the database name; 3. Press Enter to execute the command.
Command to select database in MySQL
In MySQL, you can use the USE
command to select the database to operate on. The syntax is as follows:
<code>USE database_name;</code>
where database_name
is the name of the database to be selected.
How to use the USE command
mysql
command to connect to the MySQL server, Specify username and password. database_name
with the name of the database you want to select: <code>USE database_name;</code>
Example
If you want to connect to a server named mydb
and select the database named mydatabase
, you can use the following command:
<code>mysql -u username -p password USE mydatabase;</code>
Note:
USE
command. USE CURRENT_DATABASE
. The above is the detailed content of What is the command to select database in mysql. For more information, please follow other related articles on the PHP Chinese website!