Solved

MySQL - How do I detach and attach a database in MySQL?

Posted on 2013-05-28
5
3,572 Views
Last Modified: 2015-05-07
I created a database on 1 computer and wanted to copy the database to another computer.

How can I do that using MySQL Server?

Ideally I would like to use a utility similar to Microsoft SQL management studio. Is there such a utility for MySQL?
0
Comment
Question by:dan9591
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
ID: 39203116
You can also use MySQL Workbench which is free: http://www.mysql.com/products/workbench/   But MySQL doesn't work the same as MS SQL.  You can 'dump' a database from one and import it into the other but it doesn't 'detach' and 'attach'.  See 'mysqldump': http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 168 total points
ID: 39204035
Hi!

To transfer a database between computers it is best to use mysqldump from a cmd line to dump the database and it's contents to a file and then import it to the other computer.
It is a easy and useful tool and available as part of MySQL core utilities.

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

See the manual for further info
http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html

Regards,
    Tomas Helgi
0
 

Assisted Solution

by:ppetpulliwar
ppetpulliwar earned 166 total points
ID: 39210041
Hi!

To transfer a database between computers it is best to use phpmyadmin to install in both computers and export database file in .sql ext. from computer 1 and import it to computer 2 using phpmyadmin it is very easy and gui based tool its require only iis or apache service running in ur pc or server.

then u synchronize the database in u r 2 computers and u also creating replication between tow same database
configure replication follow this link : http://santoshkumarsarkar.blogspot.com/2012/06/mysql-replication-with-phpmyadmin.html

Regards,
paresh petpulliwar
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question