Solved

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

Posted on 2013-05-28
5
3,248 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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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