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