Solved

mysqldump - server to server - all tables?

Posted on 2007-11-23
7
1,589 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

11 Experts available now in Live!

Get 1:1 Help Now