Current location - Trademark Inquiry Complete Network - Trademark registration - How to import and export data in sql database (how to import data in SQL database)
How to import and export data in sql database (how to import data in SQL database)
MySQL command line export database:

1, enter the bin folder under MySQL directory: the directory from cdMySQL to bin folder.

When I enter the command line: CDC: program files MySQL server 4.1in.

(or directly add the directory to the environment variable path of windows)

2. Export database: mysqlmp-u user name -p database name.

When I enter the command line: mysqlmp-uroot-pnews (if you export a single table, just enter the table name after the database name).

3. You will see that the news.sql file is automatically generated under the bin file.

Command line import database:

1, move. Sql file to bin file, which is a convenient path.

2, the same as the step 1 deduced above.

3, enter MySQL: MySQL-u username-p.

For example, I enter the command line: MySQL-urot-p (you will be asked to enter the password of MySQL after the same input).

4. Create a new database you want to build in MySQL-Front, which is an empty database at this time, such as creating a new target database named news.

5. Input: mysql as I Input command line: mysql6. Import file: mysql as I Input command line: mysql.