views:

171

answers:

3

I have two PCs, one is Ubuntu 8.10 and the other Ubuntu 9.10. On the Ubuntu 8.10, i have a few databases in phpmyadmin which i would like to copy across to the Ubuntu 9.10 phpmyadmin(which has no databases).

I'm not sure if i'm on the right path but here's what i think i should do:

Export the databases onto Ubuntu 8.10. And copy those files(.sql) and paste them onto the Ubuntu 9.10 PC in a folder or something. Then import these .sql files into phpmyadmin on Ubuntu 9.10.

Is there a better way to do Copy the databases across?

Thanks.

+1  A: 

From the main screen of phpMyAdmin (visible right after login) there are "Export" and "Import" links. Use these facilities to export your database (to a file on your computer) and then to import that file on the destination host.

Alternatively, if you have shell access to both machines, you could use the command mysqldump:

mysqldump --password=PASSWORD -u root DATABASE > INSERT_STATEMENTS

and then simply create all databases on the destination host with

mysql -u root --password=PASSWORD < INSERT_STATEMENTS
aioobe
A: 

Fasted way is to stop mysqld on both machines and to simply copy all the files in the data directory from one machine to the other and then to restart the mysql daemon.

e4c5
A: 

There's als MySQL Administrator that comes in the MySQL GUI Tools package. Since you've got access to both machines this is probably the easiest solution. Although I believe it just uses mysqldump, the GUI makes it a lot easier.

Htbaa