Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2003, 09:45 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Shifting of MySQL Whole Database.

Hi,

Can anyone here give me your kindest advice on how to shift the whole MySQL database from one MySQL server to another MySQL server without the need of using third party software.

Thanks alot.

Warmest regards,
Keng Yiam
 
Old September 7th, 2003, 02:11 PM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What about dumping and restoring the database? Here's a link for how to do so in the MySQL manual:

http://www.mysql.com/doc/en/mysqldump.html

There are other methods as well (direct transfer of the files from one server to another, replication), but they are dependent upon your version, which you don't mention.

Hope that helps.

Dennis Bennett
 
Old September 9th, 2003, 03:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can do it all in one shot on the commandline. I've used this method to copy an entire database from one server to another.

First, create an empty database on your target server. Then, pipe the dump output of your source database into the target host's database like so:

mysqldump -h<src_host> -u<src_user> -p<src_pass> -q <database> | mysql -h<targ_host> -u<targ_user> -p<targ_pass> <targ_database>


The -q options is the "quick" option, which means output is dumped immediately to stdout without being buffered in memory first. Generally speaking, you'll always want to use the -q option when dumping large amounts of data.



Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL database neil.abachi07 MySQL 13 October 8th, 2007 02:23 PM
shifting form dearmisskat HTML Code Clinic 0 April 4th, 2007 06:28 PM
Shifting control.. garyiskidding XSLT 1 May 22nd, 2006 07:12 AM
shifting business to C# from vb noman77 General .NET 4 October 25th, 2004 02:42 PM
MySql Database with ASP RobinR Classic ASP Databases 0 February 23rd, 2004 09:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.