How a database is copied from one machine to another?Explain with an example.

Questions by amarmail_999   answers by amarmail_999

Showing Answers 1 - 8 of 8 Answers

Mekalakn

  • Oct 24th, 2007
 

we can copy the table to our table from another table using the following sql command select * into "our table name" from "another table name"

  Was this answer useful?  Yes

dipeshpatel

  • Mar 17th, 2008
 

You can copy database from one machine to another machine by Export database.

For example, you have a “DB_1” database in IP - 192.168.0.127 machine and you have to transfer it into another machine which has IP – 192.168.0.128.

For this first of all export the database from 192.168.0.127 machine. Then after import it in IP – 192.168.0.128 machine.

DBAGop

  • Aug 8th, 2010
 

For consistent backup get downtime and then proceed.
Source machine: serverip1
destination machine: serverip2

login to serverip1:
mysqldump -u root -p --all-databases --opt --single-transaction > /moredisk_space_path/database_all.dmp

move the above file to destination machine as below

scp root@serverip1:/moredisk_space_path/database_all.dmp root@serverip2:/backup/

login to serverip2::
cd /backup
mysql -u root -p < /backup/database_all.dmp

  Was this answer useful?  Yes

Hello everybody,

We can copy database through following means
Backup( Physical or logical)
Replication

In physical backup database files are copied and pasted to target location.We can use any file backup tool for the same. In logical backup data structure and its contain are converted to create and insert queries and stored to file. When we run this file these queries are fired to destination server.

In replication there is always one master server which stores primary copy of data and one or more slave servers which stores replicated data. In slave server configuration file master server connection information is stored. Before starting replication first  master server information is copied to slave server. On master server as there is data update,delete or insert log files are updated. This updated files are transferred to slave server and same queries are fired their to update data.

Please contact me for further discussion or help at altafhsayyed@yahoo.com

Thanks and regards

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions