Seven common MySQL command lines

Source: Internet
Author: User

MySQL command lines provide many functions. The following describes seven most common MySQL command lines. If you are interested in MySQL command lines, take a look.

1. display the list of databases on the current database server:
Mysql> show databases;
Note: the mysql database contains the MYSQL system information. We change the password and add new users to use this database for operations.

2. display data tables in the database:
Mysql> USE Database Name;
Mysql> show tables;

3. Display database Definitions
Show create database yourDB;

4. display the Database Name of use:
Mysql> select database ();

5. Create a database:
Mysql> create database name;

6. delete a database:
Mysql> drop database name;

7. Import the. SQL FILE command:
Mysql> USE Database Name;
Mysql> SOURCE d:/mysql. SQL;

You can also enter the following command in the DOS environment for import:
Mysql-uroot-proot databasename <databasename. SQL
Note: before importing data, ensure that the database databasename must exist in mysql;

Use the MySQL command line to change the password

How to view MySQL user permissions

Statements that grant MySQL user permissions

Provides you with an in-depth understanding of MySQL permission management.

How to optimize mysql Indexes

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.