?
Solved

Attach / Detach a database possible in mysql??

Posted on 2006-06-17
4
Medium Priority
?
9,049 Views
Last Modified: 2008-01-09
Hello

I don't have much experience in mysql but i was wondering what would be the easiest way to move our current mysql database to another server. In MS-SQL Server there is a feature to attach/detach a database so i was looking at something like that. Of course we can export it to .sql file and import it back but this database is pretty big so that will not be possible (or last option).

thanks everyone!
0
Comment
Question by:MichaelPro
[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
4 Comments
 
LVL 8

Accepted Solution

by:
Yuval_Shohat earned 1000 total points
ID: 16927187
a good place to get some background would be"
http://www.databasejournal.com/features/mysql/article.php/3421751

but beside that,
i dont know if choosing a .sql would be my first pick...
read here:
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
http://dev.mysql.com/doc/refman/5.0/en/backup.html

-=Yuval=-
0
 
LVL 22

Assisted Solution

by:NovaDenizen
NovaDenizen earned 1000 total points
ID: 16937810
What kind of table engine do you use, MyISAM or InnoDB?  With MyISAM its as simple as just copying all the .frm, .MYI, and .MYD files from the database directory.  With InnoDB it's not so simple, and probably best to use mysqldump.

You can compress the .sql on the fly to reduce its size.
mysqldump MyDatabase | gzip -c > MyDatabase.sql.gz

To restore (after you have done "CREATE DATABASE MyNewDatabase")
gzcat MyDatabase.sql.gz | mysql MyNewDatabase
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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