Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joro

macrumors 68020
Original poster
Jun 11, 2009
2,361
41
Virginia
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.
 
I was wondering how to go about transferring two MySQL databases, each of which are about 1.3mb in size.

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...
 
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.
 
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...

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

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.

That's a good idea, I didn't think about just exporting the tables, not the entire database.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.