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
Solved

mysqldump - server to server - all tables?

Posted on 2007-11-23
7
1,591 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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20342398
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20342399
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
ID: 20343330
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 2

Author Comment

by:Mathiau
ID: 20343332
trying those queries right now also.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20343354
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
ID: 22423226
PAQed with points refunded (50)

Computer101
EE Admin
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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