473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Consolidating MySQL Servers

My organization currently has 2 different MySQL database servers. We
are in the process of moving the databases from Server A to Server B
and have Server B be our primary database server. I've done some
research on the web and believe the best option is to use the
"mysqldump" command to remotely recreate Server A's databases on to
Server B.

Can anyone please advise whether this is the best option? Also, using
the "mysqldump" command, are there any overwrite issues, such as
existing tables on Server B being overwritten by tables with the same
names from Server A. Would these tables be simply overwritten or
would there be any type of warning prompt? Thank you in advance for
any help.
Jul 20 '05 #1
2 1939
David wrote:
My organization currently has 2 different MySQL database servers. We
are in the process of moving the databases from Server A to Server B
and have Server B be our primary database server. I've done some
research on the web and believe the best option is to use the
"mysqldump" command to remotely recreate Server A's databases on to
Server B.

Can anyone please advise whether this is the best option? Also, using
the "mysqldump" command, are there any overwrite issues, such as
existing tables on Server B being overwritten by tables with the same
names from Server A. Would these tables be simply overwritten or
would there be any type of warning prompt? Thank you in advance for
any help.


Yes, I use this method when I move databases around. I do this
frequently, because I maintain a production and test instance of the
database, and also another instance of the database on a development server.

mysqldump produces as output a portable SQL script that can be used to
restore the data to any database. It's just a textual script containing
a series of CREATE TABLE and INSERT statements.

This is what I do when I move databases from one server to another:

On Server A:
mysqldump --opt mydatabase > mydata.sql
scp mydata.sql serverb:

Then on Server B:
mysqladmin create mynewdatabase
mysql mynewdatabase < mydata.sql

There's no risk of table overwriting, if you create a new database on
server b and use it for the import. But if you do accidentally import
on top of an existing database, you could destroy the existing data. So
do be careful to make sure the database doesn't exist. You can also
double-check that it's empty (i.e. just having been created) before
doing the import by doing:
mysql mynewdatabase -e 'show tables'
which should have empty output if the database is empty.

Regards,
Bill K.
Jul 20 '05 #2
Great, thanks a lot for your help, Bill.

Bill Karwin <bi**@karwin.com> wrote in message news:<cn********@enews4.newsguy.com>...
David wrote:
My organization currently has 2 different MySQL database servers. We
are in the process of moving the databases from Server A to Server B
and have Server B be our primary database server. I've done some
research on the web and believe the best option is to use the
"mysqldump" command to remotely recreate Server A's databases on to
Server B.

Can anyone please advise whether this is the best option? Also, using
the "mysqldump" command, are there any overwrite issues, such as
existing tables on Server B being overwritten by tables with the same
names from Server A. Would these tables be simply overwritten or
would there be any type of warning prompt? Thank you in advance for
any help.


Yes, I use this method when I move databases around. I do this
frequently, because I maintain a production and test instance of the
database, and also another instance of the database on a development server.

mysqldump produces as output a portable SQL script that can be used to
restore the data to any database. It's just a textual script containing
a series of CREATE TABLE and INSERT statements.

This is what I do when I move databases from one server to another:

On Server A:
mysqldump --opt mydatabase > mydata.sql
scp mydata.sql serverb:

Then on Server B:
mysqladmin create mynewdatabase
mysql mynewdatabase < mydata.sql

There's no risk of table overwriting, if you create a new database on
server b and use it for the import. But if you do accidentally import
on top of an existing database, you could destroy the existing data. So
do be careful to make sure the database doesn't exist. You can also
double-check that it's empty (i.e. just having been created) before
doing the import by doing:
mysql mynewdatabase -e 'show tables'
which should have empty output if the database is empty.

Regards,
Bill K.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marc | last post by:
Hello, Newbie here..... Searching and working this for a week now. We too are having the same problems. Using MySql 4.0.14 and there are "no problems" at all.
0
by: Luc Foisy | last post by:
Last week many of our server and client servers had a power problem. Not = quite sure how the servers were handled, wasn't on site, but I don't = think some of these servers got shut down...
1
by: adiavr | last post by:
Hi, I have read up on MySQL failover/replication and decided that weren't many cons to setting up two way replication where two servers are both master and slave to eachother. Here's the my.cnf:...
39
by: Mairhtin O'Feannag | last post by:
Hello, I have a client (customer) who asked the question : "Why would I buy and use UDB, when MySql is free?" I had to say I was stunned. I have no experience with MySql, so I was left sort...
10
by: Simon | last post by:
Hi, I need to export a 200MB database from one domain to another. phpMyAdmin timeout after a while and is not ideal. I don't mind spending money if I have to but this is rather urgent. I...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
5
by: linuxlover992000 | last post by:
I am a newbie in the world of MySQL. In fact I enabled it in my Linux box only because it is required to run WordPress (the blogging software). I was trying to plan ahead and figure out a way to...
8
by: deko | last post by:
I've just loaded phpMyAdmin on a Debian Linux server with Apache2, MySql5 and PHP5. myserver # dpkg -l | grep php ii libapache-mod-php5 5.2.0-8+etch4 ii libapache2-mod-php4 4.4.4-8+etch2 ii...
2
by: 2401 members, members can post | last post by:
Always MultiPost and Cross-Post messages to enhance the chance to reach you. Bob Hi, Ever be in a position of too-much traffic ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.