Using the command line mysql export and import statements

mysql export statement

Enter the command line

mysqldump -uroot -ppassword java > java.sql

mysqldump -uroot -ppassword --databases java >java2.sql

These two statements can be exported sql statement, the second difference is that the use of the sql statement to export more than the following sql statement using the first export:

 

--
-- Current Database: `java`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `java` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `java`;

 

This statement is used to create the database, so use according to their needs!

 

mysql import statements

Be logged in mysql

use database;

source d:/xxx.sql;

Published 26 original articles · won praise 6 · views 1485

Guess you like

Origin blog.csdn.net/shuttle33/article/details/102616702