SSH & MySQL problem uploading database


#1

I’ve had a really bizarre evening. Yesterday my database contained all of my data, as kindly uploaded by Dreamhost’s Customer Service Team. This evening I have an empty database! All of the tables still show their structure, as I verified in phpMyAdmin, but the data is gone.

My original database file is still in my root directory, and contains all the missing data, and I’ve got a ticket in asking for help, but I really want to know how to do this myself!

I have installed and configured puTTY. I successfully SSH’d into my domain and got connected. From there I entered the line of code that should enable upload of my database according to the Dreamhost panel:

mysql -u janievfb -p -h vfb-db1.viggofanbase.com web_vfb

and got back a message: error 1064 (42000) error in SQL syntax.

I am a novice at SQL and have no idea how to fix this. I went to the knowledge base “how do I dump data into MySQL” and tried their code lines, which use a different order from the above line, showing the database first. I got a little farther that way, but not much. I tried mysqlimport, I tried UPLOAD, I even tried to go to the SQL resource for all these commands and it didn’t help either. My user password was recognized at one point and disallowed later in this process.

Can anyone help? I’d like to be able to know how to do this if something goes wrong again, without constantly sending tickets in to the support team. Or if I want to import another database.

I hate to say it, but this is one case where I am nostalgic for cPanel.


#2

mysql -u janievfb -p -h vfb-db1.viggofanbase.com web_vfb < filename.sql

filename.sql being the sql file you got from mysqldump (or similar).

HTH


#3

Thanks, Rusty, I’ll try that. I figured it was probably something simple, but was getting swamped with all the code. I guess I probably should have posted this in the new user section, too. Live & learn…


#4

Where does the .sql file need to be sitting at in order to slurp it in in this way?

Any assist appreciated!

Thanks,

Alar


#5

just upload the sql file into your root directory, that way you can run the command from ssh, with out having to move into a directory.

-Matttail


#6

Thanks!

379Mb slurped in…took about an hour…