Announcement

Collapse
No announcement yet.

How do I restore my database?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I restore my database?

    Thank god I created a backup of my database. I was messing around in phpmyadmin and I accidently dropped my WHOLE vbulletin database. I created a new database called vbulletin and of course there is nothing in it at all, however I did back up my whole database in one complete text file using the vbulletin backup database under the admin panel. I am wondering how I go about restoring this database? Do I just go into phpmyadmin and attach the text file to execute under the SQL section? I tried that but it says "No SQL Query"

    Can anyone help me out here?

    Thanks
    Chris

  • #2
    Do you have shell access?

    If so, upload the dump via FTP to your webspace.

    Then type the following into the console:

    Code:
    mysql -uusername -ppassword -hdatabaseserver databasename < yourdumpfile.sql

    Comment


    • #3
      If your database server is local host, you wont need the -h option.

      The reason why you got a "No SQL Query" is because of the php timeout which I think maybe set to 30 seconds as default, if the query isn't executed in that time that is the error you will get.

      Comment


      • #4
        Originally posted by poolking
        If your database server is local host, you wont need the -h option.

        The reason why you got a "No SQL Query" is because of the php timeout which I think maybe set to 30 seconds as default, if the query isn't executed in that time that is the error you will get.
        Yeah my database back up was over 3Mb so that explains why it timed out. Since my website is being hosted from my own server would the Telnet option even work either? Im still trying to figure out how to use Telnet and what it really is. Also would it be wise to change the PHP timeout from 30 seconds to say something higher?

        Thanks
        Chris

        Comment


        • #5
          Originally posted by Salazar
          Do you have shell access?

          If so, upload the dump via FTP to your webspace.

          Then type the following into the console:

          Code:
          mysql -uusername -ppassword -hdatabaseserver databasename < yourdumpfile.sql
          Type this into what console?

          Comment


          • #6
            What operating system are you using?

            Comment


            • #7
              You will need a program like PuTTY.

              Comment


              • #8
                I am using Win 2K Server. Also what is Putty and what does it do? I dont know much about this sort of stuff.

                Thanks

                Comment


                • #9
                  Originally posted by Salazar
                  You will need a program like PuTTY.
                  He stated that he is running it on his own server so telnet prog is not needed, all he needs to do is go to the command prompt and run in the mysql\bin directory

                  mysql -u username -p password nameofdatabase < pathtobackup/nameof.sql

                  Comment


                  • #10
                    Originally posted by poolking
                    He stated that he is running it on his own server so telnet prog is not needed, all he needs to do is go to the command prompt and run in the mysql\bin directory

                    mysql -u username -p password nameofdatabase < pathtobackup/nameof.sql
                    Ok so I am not a DOS guy so this is all new to me. From what I understand I need to open a Commad Prompt which I know how to do... Then I need to type in something like PATH=mysql/bin Is that right so far? Then I would type in this... mysql -u username -p password nameofdatabase < pathtobackup/nameof.sql ? And I assume that it just automatically restores the database from there? I just need step by step instructions for this first time since I dont even know what commands do what in DOS. Will it recreate the vbulletin database even if the database itself was deleted? Thanks for all the help. I am suprised that VBulletin hasn't included something like this in their manual for people running their own server. May I ask how you know how to do this aside from just being smart? Does it tell you how to do stuff like this on the MySQL website?

                    Thanks alot man
                    Chris

                    Comment


                    • #11
                      Originally posted by EVO VIII Chris
                      Ok so I am not a DOS guy so this is all new to me. From what I understand I need to open a Commad Prompt which I know how to do... Then I need to type in something like PATH=mysql/bin Is that right so far? Then I would type in this... mysql -u username -p password nameofdatabase < pathtobackup/nameof.sql ? And I assume that it just automatically restores the database from there? I just need step by step instructions for this first time since I dont even know what commands do what in DOS. Will it recreate the vbulletin database even if the database itself was deleted? Thanks for all the help. I am suprised that VBulletin hasn't included something like this in their manual for people running their own server. May I ask how you know how to do this aside from just being smart? Does it tell you how to do stuff like this on the MySQL website?

                      Thanks alot man
                      Chris
                      You have got the paths correct, but It won't re-create the database.

                      So you will have to recreate the database add the same user that is listed in the config.php file and password. Then grant all privileges to that user, then run the mysql command you listed.

                      This will then create all of the tables again, including all info in the tables.

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...
                      X