Solved

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

Posted on 2015-01-24
5
159 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 28

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 61

Expert Comment

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

mysql < backup.sql
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 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 61

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Creating and Managing Databases with phpMyAdmin in cPanel.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

12 Experts available now in Live!

Get 1:1 Help Now