Wednesday, May 5, 2010

Copy dan Restore MYSQL database

Gunakan mysqldump utk buat copy database:
$ mysqldump -uroot -p***** namadatabase > /home/nazril/namadatabase.sql

copy namadatabase, letak dlam folder /home/nazril

utk restore pulak:
$ mysql -uroot -p**** namadatabase < /home/nazril/namadatabase.sql

pastikan dah create dulu database 'namadatabase' kat dlm mysql tu.. nnt error ni akan keluar:
ERROR 1049 (42000): Unknown database 'namadatabase'

No comments: