Backing up and restore MYSQL DB under *Unix

Started by admin, November 28, 2009, 03:12:18 AM

Previous topic - Next topic

admin

To create a back up file under unix or lunix use:

mysqldump -u USER -pPASSWORD DATABASE_NAME > DATABASE_NAME.sql

where USER: the database user name,
PASSWORD: the password for that user,
DATABASE_NAME: the Database name.

If you have the sql file and want to restore your database from, you can use the following:

mysql -u USER -pPASSWORD DATABASE_NAME < DATABASE_NAME.sql