Select MySQL database (MySQL USE statement)

In MySQL, the USE  statement is used to complete a database to jump to another database.

 

After creating a database using the CREATE DATABASE statement, the database does not automatically become the current database, USE need to specify the current database. The syntax is:

USE <database name>

This statement may notify the MySQL <数据库名>database as indicated by the current database. The database remains the default database until the end of the discourse, or until I met a different USE statement.

After only specify a database as the current database using the USE statement to perform operations on the data objects stored in its database.

[Example] Using the command line tool test_db database as the default database, SQL statements, and input the execution result is as follows:

  mysql> USE test_db;  Database changed

Guess you like

Origin blog.csdn.net/mysqlsd/article/details/103652934