?
Solved

Linux MySQL

Posted on 2012-03-12
2
Medium Priority
?
417 Views
Last Modified: 2012-03-25
How can I make a copy of all of the databases in a MySQL  server and move them to another server?  I believe they all have different logins so looking for an easy process.
0
Comment
Question by:Jack_son_
[X]
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
2 Comments
 
LVL 21

Assisted Solution

by:K V
K V earned 1000 total points
ID: 37713416
- if you have root access you can do mysql dump.
- if you have filesystem access you may stop mysql / flush tables with read lock and then copy data files.
- dump each of the db one by one!! may be a shellscript will do the job! You may directly redirect it to target db if it's accesible:
mysqldump -uUSER -pPASS --databases DB1 | mysql -uUSER -pPASS -hREMOTEHOST/IP
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 1000 total points
ID: 37713866
Hi!

The easiest way is to use mysqldump as theGhost_k8 says.
To dump all the databases you issue
mysqldump -uUSER -pPASS --all-databases > dumpfile.sql
and then issue
mysql -uUSER -pPASS < dumpfile.sql

http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

Hope this helps.

Regards,
     Tomas Helgi
0

Featured Post

AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦
Suggested Courses

719 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