Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an SQL Backup that has hundreds of individual databases inside of it. The backup is around 70GB in size and I have spent countless hours attempting to restore it on a new machine due to the previous one becoming corrupted.

I am currently trying to restore this by doing...

mysql -u root -p > E:\CHI.sql

As soon as I run this, the SQL backup goes to 0KB and nothing else happens. What can I do to restore this SQL Backup as this is quite urgent and I have never experienced such issues.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You are redirecting the wrong way. Your command, as written, writes stdout of the mysql process to your .sql file. Give that angle brace a 180 degree spin and give 'er another try.

share|improve this answer
    
Thanks, I will give it a try in just a couple minutes. Each time it does this I have to copy the SQL back over from another machine which takes a while at that size. The VPS drive is too small for me to create a backup of it on the Database machine –  Brett Powell Nov 26 '13 at 2:53
    
If 3306 on your db server is available over the network, then you can do the restore over the network as well, using the mysql client library from another host. That would likely save you quite a bit of time. –  EEAA Nov 26 '13 at 2:55
    
We purchased some software to run on our primary backup node which I tried to use earlier for a restore over TCP/IP but wasn't having much luck. I opted to just copy it over via FTP and restore, but what sounds like stupidity on my part has resulted in some sitting around twiddling my thumbs during transfers –  Brett Powell Nov 26 '13 at 2:58
    
Thanks, that stupid little mistake was it. I guess I flipped it around at some point not realizing it. Getting crap about access denied for information_schema but I will make a new post. Thanks again! –  Brett Powell Nov 26 '13 at 3:15
    
@BrettPowell You're welcome. No offense, but it sounds like you're googling for commands to run, and are running them without a clear understanding of what the commands do. Needless to say, this is very dangerous. When learning a new command, don't just copy/paste. Really seek to learn what's going on. If you'd done this with your restore command, you would have wondered why in the world the file was being overwritten, followed very shortly by the realization that you were redirecting the wrong way. –  EEAA Nov 26 '13 at 3:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.