Web Hosting Talk







View Full Version : Moving Mysql databases


poring
12-29-2001, 11:42 AM
Hey
Could anyone please tell me how to move my MySQL databases from one host to another?
Thanks

MarcD
12-29-2001, 11:44 AM
get phpadmin

http://www.phpwizard.net/projects/phpMyAdmin/

{NIRMANI}
12-29-2001, 11:46 AM
You can get a database dump to a file ( usually named *.sql) & populate the new database at new host using that file.

DomiNET.net
12-29-2001, 12:19 PM
Thats correct, if you have ssh/telnet access you can use mysqldump command

poring
12-29-2001, 12:26 PM
Thanks, but I'm still a little confused..

What do I do when I'm in phphMyAdmin?

I have this: http://users.pandora.be/fourtyseven/bleh.gif

Now what do I do?

Thanks

MarcD
12-29-2001, 12:34 PM
in the selection boxes select structure and data
and send gzipped i believe

and click go

this looks like an older version im not used to but that should save your database to a sql file


after you have it saved when u switch hosts or whatever u are doing


create your database

mytest again

then select
broswe and select the sql file that u saved from your old one

then hit go

it will import the tables and data into your new database

=)

huh
01-09-2002, 04:54 AM
I have a copy of all the databases under the old /data dir, can I untar it and drop it on the new data dir?

it's a new server

thanks in advance...

priyadi
01-09-2002, 07:00 AM
Originally posted by poring
Hey
Could anyone please tell me how to move my MySQL databases from one host to another?
Thanks

l33t way to do that: :)


oldhost$ mysqldump -u olduser -p olddb | gzip | ssh newuser@newhost "gunzip | mysql -u newuser -p newdb"

MDJ2000
01-09-2002, 11:01 AM
You should probably add the --opt in there between the dump and username as well, especially if it's a large database.

$.02

goodness0001
01-09-2002, 07:02 PM
mysqldump --opt -u username -p database > file.sql