Announcement

Collapse
No announcement yet.

importing db from one db to another...

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

  • importing db from one db to another...

    How do i import a db from the same version of vbulletin...

    the story is i changed hosts but would like to keep my current db... i have a sql dump of my previous db and need to import it into the new db... any one know how?

  • #2
    Assuming that your backup file is called backup.sql, and the new (empty) database is called 'newdatabase' - -

    1) Telnet into your server

    2) cd to the mysql/bin folder - something like cd /usr/local/mysql/bin

    3) run the following command:
    Code:
    ./mysql -uusername -ppassword newdatabase < /path/to/backup.sql
    This will instruct mysql to insert the contents of the backup file into the empty database.

    Comment


    • #3
      If i am unable to telnet as i do not have sufficient privelages to do that is there any other way?

      Comment


      • #4
        ERROR 1049: Unknown database 'newdatabase'
        What am I doing wrong?! I've been tearing my hair out.

        Comment


        • #5
          Or I'll get a "ERROR 1050 at line 11: Table 'access' already exists" if I use a database name that I know exists. How do I tell it to overwrite?

          Comment


          • #6
            You can either redump with the --add-drop-tables flag (I think that's it) or drop all the tables in the database you're importing too.

            Comment


            • #7
              Ok.. that works.. thanks.

              Comment

              Loading...
              Working...
              X