1, install the MySQL client on Linux, then enter the MySQL console with the following command, then you can execute various SQL statements:
mysql-h10.2.120.1-utest-p123456
Use DB1
Where 10.2.120.1 is the IP address of MySQL, the default port number 3306,test is the user name, 123456 is the password, and DB1 is the name of the DB instance.
2, execute the following command, export the entire database SQL script (table structure + data):
mysqldump-h10.2.120.1-utest-p123456 db1 >./db1.sql
Where DB1 is the name of the DB instance.
3. Export the structure and data for the specified table in the specified database:
mysqldump-h10.2.120.1-utest-p123456 db1 table1 >./table1.sql
Where DB1 is the name of the DB instance, and Table1 is the name of the table to be exported.
4. Export the structure and data of the specified table in the specified database, using the specified where condition filter:
mysqldump-h10.2.120.1-utest-p123456 db1 table1--where= "xxx" >/table1.sql
Where DB1 is the name of the database instance, Table1 is the name of the table to be exported, and XXX is the Where condition.
5. View MySQL Database status:
mysql> status;
6. View the value of the specified variable:
Mysql> Show variables like '%max_connections% ';
7. View the list of currently executing commands:
Mysql> show Processlist;
8. Terminate the specified command:
Mysql> Kill process_id
Specific process_id can be obtained through the show processlist command.
MySQL Common commands