Solved

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

Posted on 2013-05-28
5
2,239 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
5 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
Comment Utility
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 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 168 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now