Solved

Attach / Detach a database possible in mysql??

Posted on 2006-06-17
4
8,782 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
4 Comments
 
LVL 8

Accepted Solution

by:
Yuval_Shohat earned 250 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 250 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

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 …
Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

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

10 Experts available now in Live!

Get 1:1 Help Now