useTUTORIALS;Databasechangedmysql>Now that we have selected TUTORIALS"/> useTUTORIALS;Databasechangedmysql>Now that we have selected TUTORIALS">

Home  >  Article  >  Database  >  How do we select the database from the command prompt after connecting to the MySQL server?

How do we select the database from the command prompt after connecting to the MySQL server?

王林
王林forward
2023-09-02 12:17:021388browse

连接到 MySQL 服务器后,我们如何从命令提示符中选择数据库?

#Once we connect to the MySQL server, we need to select the database we want to use. This is because the MySQL server may have multiple databases available.

Selecting a database from the mysql> prompt is very simple. We can use the SQL command "use" to select the database. To illustrate this, we select the database named "Tutorials" in the following example -

Example

[root@host]# mysql -u root -p
Enter password:******
mysql> use TUTORIALS;
Database changed
mysql>

Now that we have selected the TUTORIALS database, the following All operations will be performed on the TUTORIALS database.

The above is the detailed content of How do we select the database from the command prompt after connecting to the MySQL server?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete