Solved

mysqldump - server to server - all tables?

Posted on 2007-11-23
7
1,588 Views
Last Modified: 2008-09-08
mysqldump tool is a new one to me, i have been reading the many many MANY uses for it, but one in particular i wish to use, to dump an entire DB to a new DB server.....

I have attemped to use the below string, but nothing happens, so as usual, i blame myself :) for likely mssing something , or miss understanding something

==============================
mysqldump --opt -h 1.1.1.1 -u root  | mysql --host=2.2.2.2 --user=root -C
==============================

now since i want it to copy ALL tables, do i need to specify anything after -C ?, moving the data from server 1.1.1.1. to server 2.2.2.2

i do it in a mysql command prompt and i press enter and all i get is a new line

->

and nothing happens, neither DB has password on it so i didnt include the -p part.
0
Comment
Question by:Mathiau
  • 3
  • 2
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
you should include the database name you want to copy on both sides:
mysqldump --opt -h 1.1.1.1 -u root dbname | mysql --host=2.2.2.2 --user=root -C -D dbname

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
of course, does this return anything:
mysqldump --opt -h 1.1.1.1 -u root dbname

if yes, does this also work:
mysqldump --opt -h 1.1.1.1 -u root dbname > yourfile.sql

if yes, does this work:
mysql --host=2.2.2.2 --user=root -C -D dbname < yourfile.sql


0
 
LVL 2

Author Comment

by:Mathiau
Comment Utility
What if i want to copy all of the databases with in the data/ folder? or is that not possible? i need to go one by one ?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Author Comment

by:Mathiau
Comment Utility
trying those queries right now also.
0
 
LVL 2

Author Comment

by:Mathiau
Comment Utility
i am running the query on another system  (i am tyig to backup 1.1.1.1 , i am running the query from system 2.2.2.2 using query browser and also trying command prompt)

mysqldump --opt -h 1.1.1.1 -u root tournaments

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump --opt -h 1.1.1.1 -u root tournaments' at line 1
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed with points refunded (50)

Computer101
EE Admin
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

13 Experts available now in Live!

Get 1:1 Help Now