Author Topic: Backing up and restore MYSQL DB under *Unix  (Read 4883 times)

Offline admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 296
    • View Profile
Backing up and restore MYSQL DB under *Unix
« 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