Solved

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

Posted on 2015-01-24
5
166 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 79

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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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 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…

630 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