sql - Moving a mysql database from one vps to another -


i'm moving large wordpress mysql db (1.49gb) old server new one, did to:

mysqldump -u root -p dbname > public_location/db.sql 

then did a:

wget http://oldserver/db.sql 

i created database on new server, created user, then:

mysqldump -u root -p dbname < db.sql 

it says dump completed, why database on new server still empty? don't see tables @ all.

rather call mysqldump on new server input file, call mysql

mysql -u root -p dbname < db.sql 

you can, if brave , second vps has port 3306 open old 1 via tcp , have user account root@oldserver able write, in 1 action:

# pipe dump directly old vps new vps: mysqldump -uroot -p dbname | mysql -h newserver -uroot -p dbname 

i wouldn't attempt on internet, i've done on lan several times.

finally, don't forget --routines parameter if have stored functions , procedures need migrate database. won't go dump without it.

mysqldump --routines -u root -p dbname > public_location/db.sql 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -