As an example, I will introduce how to use the command line to export and import MySQL into the database. 1. Export the database through the command line 1. Enter the bin folder under the MySQL directory: cd. The directory to the bin folder in MySQL is such as: cd C:\Program Files \MySQL\MySQL Server 4.1\bin (or directly add this directory to the Windows environment variable path) 2. Export the database: mysqldump -u username -p database name> Exported file name For example, the command line I entered: mysqldump -u root -p news > news.sql (After entering, you will be asked to enter the password to enter MySQL) (If you export a single table, just enter the table name after the database name) 3. You will see the file news.sql automatically Generate it under the bin file. 2. Import the database from the command line: 1. Move the .sql file to be imported to the bin file. This path is more convenient. 2. Same as the first step of exporting above: enter
1. How to export and import database using MySQL command line
##Introduction: Example: Let’s introduce how to use the command line to export and import MySQL into the database. 1. Export the database through the command line 1. Enter the bin folder under the MySQL directory: cd to the bin folder in MySQL, such as: cd C:\Program Files\MySQL\MySQL Server 4.1\bin (or directly add this directory to the windows environment variable path) 2. Export the database: mysqldump -u username -p number
2. Speed up mydumper and myloader export import
Introduction: mydumper and myloader are excellent third-party MySQL database logical backup and recovery tools , using multi-threaded export and import. It makes up for the shortcomings of mysqldump's single thread. This article describes how to speed up the export and import of mydumper and myloader for your reference.
3. MySQL command line export and import database_MySQL
Introduction: This article is mainly for everyone. This article introduces examples of using the command line MySQL to export and import databases. Interested friends can refer to
4. Examples of php exporting and importing csv files
Introduction: Examples of exporting and importing csv files from PHP
5. How to solve the problem of garbled data in mysql import and export
Introduction: In mysql, our most commonly used export and import database is the mysqldum operation. However, if the encoding is not specified, garbled characters may appear when exporting. The solution is: mysqldump specifies the encoding. Then export the database
The above is the detailed content of Summary of examples of database export and import. For more information, please follow other related articles on the PHP Chinese website!