Solved

Attach / Detach a database possible in mysql??

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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