Helping Moving MySQL Databases

Discussion in 'Web Design and Development' started by joro, Aug 6, 2009.

  1. joro macrumors 68020

    joro

    Joined:
    Jun 11, 2009
    Location:
    NOVA
    #1
    I am in the process of switching hosting companies and I was wondering how to go about transferring two MySQL databases, each of which are about 1.3mb in size. I am somewhat familiar with PHPmyAdmin and I’ve tried exporting the database; however, when I try to import on the other server it’s giving an error because it’s trying to create a brand new database.

    Similiarly, another problem involves the naming of those databases. My current host has this named like this:

    name_blog

    And my new host has them named like this:

    name1_blog

    I want to make sure that that change, while minor, will not affect database or table structure/content. Any advice you all could give would be much appreciated, I’ve tried doing Google searches but haven’t had success thus far.
     
  2. JFreak macrumors 68040

    JFreak

    Joined:
    Jul 11, 2003
    Location:
    Tampere, Finland
    #2
    Have you already tried this:


    # mysqldump -u username -p password db_name > file.sql
    # mysqldump -u username -p password db_name < file.sql


    Hope this helps...
     
  3. Joined:
    Jun 30, 2009
    #3
    Hmm... I don't know anything about phpMyAdmin, I use the command-line, but does PMA export databases, or tables? If it exports tables, it wouldn't be a problem. You just replace the database name in your scripts, and insert the tables in the new database.
     
  4. joro thread starter macrumors 68020

    joro

    Joined:
    Jun 11, 2009
    Location:
    NOVA
    #4
    Can that be run inside phpmyadmin or is that from the command line <-- my current server doesn't allow command line access from what I understand

    That's a good idea, I didn't think about just exporting the tables, not the entire database.
     
  5. Maxington macrumors 6502

    Joined:
    May 11, 2007
    Location:
    Oshkosh, WI
    #5
    If your using WP then try google for "Wordpress Migration" etc this may provide more specific info.
     

Share This Page