Application Example: database1 (abbreviated DB1) saved in MySQL in PC1, need to migrate DB1 to MySQL in PC2
environment : win7 MySQL5.7.13
Reference: http://stackoverflow.com/questions/22447651/copying-mysql-databases-from-one-computer-to-another
Steps:
- Export DB1 in PC1 to a SQL file
mysqldump -u root -p database_name > database_name.sql
Note 1: If the MySQL installation bin is not placed under the system path, then the path to install MySQL _/bin folder open cmd window (shift+ the right mouse button, select ' Open command Line window here '), and then enter the above instructions
Note 2: The exported SQL file is saved in the Bin folder
- Copy the exported SQL file to the Mysql/bin folder in PC2
- PC2 Create a new database
create database database_name
- Enter the PC2 Mysql/bin folder and open the cmd window here to execute the following command
mysql –u root –p database_name < database_name.sql
From for notes (Wiz)
MySQL database transfer between computers