Restoring MySQL Database


#1

Hey, I read an older post about MySQL on here from a guy called “nintoez”, so please don’t refer me to that thread to answer this question for me, because after reading through it, I’m still sorta confused.

I’m a n00b as well when it comes to MySQL, but I’m getting it as I go. I restored one database already which for some reason was really easy (it was under 7MB, so I just used the PhpMyAdmin) but this other database is a SMF messageboard that’s pretty big. It’s actually 9MB so I learned how to log into my SHH client.

Anyway, here’s the steps according to how I understand them. I have a backup SQL file from my old server with a different company that I want to bring over here, so the login and everything for that one was different than what this one is now. So here it goes:

  1. I took my file (database.sql) from my desktop to FTP into my root folder “/”.
  2. I opened my web browser and went into my panel, I went into Panel > Goodies > MySQL > New Database
  3. I created a new database “database2”

Aaand… here’s where I’m stuck. Can anyone help me at this point? I’ve looked at the wiki guides and I just can’t find which step I need need to do next.


#2

[quote]1) I took my file ([color=#CC0000]database.sql[/color]) from my desktop to FTP into my root folder “/”.
2) I opened my web browser and went into my panel, I went into Panel > Goodies > MySQL > New Database
3) I created a new database “[color=#0000CC]database2[/color]”[/quote]
Okay that’s great!

Now all you need do is login to shell (I prefer PuTTy) and…

mysql -u DBusername -pDBpassword -h DBhostname [color=#0000CC]database2[/color] < /[color=#CC0000]database.sql[/color]

  • Note that there is no space between -p and the database user’s password.

What this is doing is first verifying your DBusername and DBpassword at your DBhostname, then inserting the file [color=#CC0000]database.sql[/color] into [color=#0000CC]database2[/color].

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost