Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how do I restore mysql --all-databases dump?

Posted on 2015-01-24
5
Medium Priority
?
168 Views
Last Modified: 2015-02-13
On a centos linux server, I'm moving from one server to another.

I dumped my current database using this:

# mysqldump -u root -ptmppassword --all-databases > /tmp/all-database.sql

then moved the database.sql file over.

Now, how do I restore all databases?  There is some content in the current databases of the same name that I would like overwritten,

Chris
0
Comment
Question by:St_Aug_Beach_Bum
5 Comments
 
LVL 29

Expert Comment

by:chilternPC
ID: 40568578
I would have use phpmyadmin to back up the tables in the database and then use to it to restore the tables to a different  MySQL

http://www.phpmyadmin.net/home_page/index.php
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40568593
Yeh, I would have liked to do that too, unfortunately I'm dealing with a server that got hacked and is in recovery mode, I can ssh in and do a limited number of things, but no phpmyadmin :)
0
 
LVL 62

Expert Comment

by:gheist
ID: 40568600
sl scripts can e fed to mysql client command line

mysql < backup.sql
0
 
LVL 80

Accepted Solution

by:
arnold earned 2000 total points
ID: 40568601
note this will overwrite all including the mysql security/db/.
the file has the data in clear text readable directions.
on the new system.
mysql  -u root -p < all-database.sql
0
 
LVL 62

Expert Comment

by:gheist
ID: 40568613
In theory you need to run mysql_upgrade after - it knows how to update system DBs for last few mayor versions.
Should it fail you must go database by database.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

885 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