sami
sami

Reputation: 947

Import/Exporting databases from one machine to another

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.

Upvotes: 1

Views: 1063

Answers (2)

Htbaa
Htbaa

Reputation: 2309

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.

Upvotes: 0

aioobe
aioobe

Reputation: 421290

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

Upvotes: 1

Related Questions