Kamis, 09 Agustus 2012

Backup MySQL Database to File on Ubuntu


If we have a large size mysql database, and want to backup the database. We can't use tools like phpMyAdmin to do this. We have to try another way to backup the large size mysql database. In Ubuntu, we can use terminal as tool to backup mysql database, with mysqldump command. 

$ mysqldump -h (host) -u (username) -p(password) (databasename) > (filename).sql;

NB:
there is NO SPACE between -p and (password).

example:

$ mysqldump -h localhost -u root -pCoba dbexample > dbexample.sql;

The sql file will create after the command is over.

Tidak ada komentar:

Posting Komentar