Mysql-related operations (2)

Source: Internet
Author: User


Mysql (2) Database Operations Mysql database operations mysql-u username-p password to log on to the mysql database. 1. display the existing database command: show databases; used to display the information of the created database. Command: show databases [LIKE char] This command indicates that the database is displayed and matches the subsequent characters. If [LIKE char] is used, the char string can be a string that uses the "%" and "_" wildcards of mysql. For example, show databases like 'My % '; this indicates that the database name starts with' %. Www.2cto.com 2. create database Command: create database dbname; this statement is used to CREATE a DATABASE named dbname. If the database name already exists, an error is returned. 3. Run the drop database [if exists] dbname command to delete a DATABASE named dbname. Use it with caution. [If exists] is used to prevent the deletion operation because the table does not exist. 4. Select the database command: USE dbname; the function of this statement is to select a database named dbname.

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.