MySQL use command Select database detailed _mysql

Source: Internet
Author: User

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!

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.