Solved

Attach / Detach a database possible in mysql??

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL Error Code 2 27
Help needed with Powershell  XML to MySQL 5 75
MySQL Warning Statements when you have a LIMIT clause. 6 47
Unwanted output from my query 5 42
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

726 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