0

Following are the details of the database and server:

Server1: Host Name: abc Port Num: 01 database: test

Server2: Host Name: xyz Port Num 02 database: spareparts userid: spts password: abcdefgh@123

I have to copy all tables from database test to database spareparts.

Please guide me how I can copy them. I am new in using mysql. Also please let me know if any other details are required.

1

There are several methods you can use such as

  • mysqldump
  • folder copy
  • enterprise backup

for mysqldump use following command:

mysqldump -uuser -ppassword --database your_db_name --routines --triggers --events --lock-all-tables >outputfile.sql 

and use following command at destination:

mysql -uroot -ppassword<outputfile.sql.

You can also use following method - stop server at source - stop server at destination - copy all the database folders from source to destination - start destination server - start source server

Hope it helps

| improve this answer | |
  • What is -uuser -ppassword – sravan kumar Nov 2 '14 at 12:08
  • it is format in which you provide username and password in mysql command line. – Nawaz Sohail Nov 5 '14 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.