Solved

mysqldump - server to server - all tables?

Posted on 2007-11-23
7
1,590 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]
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 142

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Creating and Managing Databases with phpMyAdmin in cPanel.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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