Mysql use command select database details, mysqluse

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.