Copy mysql database from one server to another using Bat Script,Mysql transfer the data one server to another

1. mysqldump.exe is needed
2. Change user name, password,port and server Ip address
3. Change Database Name.

Example:
Echo off
Echo ***Please Wait DataBase Transfering***
(cd C:\Program Files\MySQL\MySQL Server 5.6\bin && ^
mysql -h 192.168.1.12 -u root -p1234 --port=3306 -e "CREATE DATABASE IF NOT EXISTS `Admin`" && ^
mysqldump --routines=true -h 192.168.1.225 -u root -p1234 --port=3306  Admin | mysql -h 192.168.1.12 -u root -p1234 --port=3306 Admin)> transferlog150331.txt  2>&1
Echo ***
Timeout 10

Post a Comment

1 Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete