Developers Heaven Forum

DataBase => MySQL => Topic started by: admin on November 28, 2009, 10:12:18 AM

Title: Backing up and restore MYSQL DB under *Unix
Post by: admin on November 28, 2009, 10:12:18 AM
To create a back up file under unix or lunix use:

Code: [Select]
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:

Code: [Select]
mysql -u USER -pPASSWORD DATABASE_NAME < DATABASE_NAME.sql