Moving database to a new host

Discussion in 'MySQL' started by seopup, May 1, 2006.

  1. #1
    HI ,

    I have moved my website to a new host and I can't upload all .sql file as it says
    Anyone can recommend another method ?

    (database is big)
     
    seopup, May 1, 2006 IP
  2. seopup

    seopup Peon

    Messages:
    274
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    OK , not very big , 5 MB.
     
    seopup, May 1, 2006 IP
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What are you using to upload it?
     
    exam, May 1, 2006 IP
  4. seopup

    seopup Peon

    Messages:
    274
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    phpMyAdmin
     
    seopup, May 1, 2006 IP
  5. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Try uploading the actual file via FTP, and then open up an SSH session to your server (PuttY is a good SSH client), and do the import via the mysql command line program.
     
    exam, May 1, 2006 IP
  6. ForgottenCreature

    ForgottenCreature Notable Member

    Messages:
    7,473
    Likes Received:
    173
    Best Answers:
    0
    Trophy Points:
    260
    #6
    Have you tried asking your host if they could restore the sql backup for you?
     
    ForgottenCreature, May 1, 2006 IP
  7. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #7
    In most cases the max file size phpMyAdmin can handle is 2M.

    An sql is just a plain text file, break it into smaller files, just make sure to run them in the correct order.
     
    mushroom, May 1, 2006 IP
  8. iowadawg

    iowadawg Prominent Member

    Messages:
    10,918
    Likes Received:
    811
    Best Answers:
    0
    Trophy Points:
    380
    #8
    As I have 167mb to load to my database today!!
    Broken down into quite a few files, but still at 3mb to 10mb a file.

    Does anyone know if I can use cute ftp to upload?
    If so, how?

    Will find out later today if I can get this uploaded.
     
    iowadawg, May 1, 2006 IP
  9. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Sure you can use any FTP client to upload to to your webspace. Then you need to import it into MySQL via the command line.
     
    exam, May 1, 2006 IP
  10. seopup

    seopup Peon

    Messages:
    274
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #10
    No SSH here :( .

    I should write a script that will get data from one server and move it to another .

    Also there is another way ...

    On a MySQL table you do an SQL query:

    select * from table_name into outfile '/home/user/my_writeable_directory/table1.txt'

    After this you get only structure for this table and make the table structure on new webserver using phpMyAdmin.

    Upload table1.txt to the new host .

    Do an SQL query on the new host :

    load data local infile '/home/user/table1.txt' into table_name

    http://www.mysql.com if you get any SQL errors (not tested )
     
    seopup, May 2, 2006 IP
  11. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Split your SQL file into 3 parts and do it separately within phpmyadmin.
     
    exam, May 2, 2006 IP