Solved

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

Posted on 2015-01-24
5
164 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
[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
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 78

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 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

Industry Leaders: 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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
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.:

735 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