1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I want to ask how to backup an existing
    mySQL database ?

    thanks for help !
  2. #2
  3. No Profile Picture
    rod k
    Devshed Newbie (0 - 499 posts)
    You can use mysqldump. Go to your mysql/bin/ directory and type this:

    mysqldump -u username -ppassword your_db_name > /path/to/dir/filename

    This will create a text file containing all the commands to recreate the tables in your_db_name and commands to insert the data into the tables.

    You can recover by dropping all tables from the db (or dropping the db itself, then recreating it with create database your_db_name). Then, from the OS command line issue:

    mysql -u username -ppassword < /path/to/dir/filename

    That's it.


Similar Threads

  1. Database backup
    By dsm56 in forum PHP Development
    Replies: 1
    Last Post: December 10th, 2002, 03:17 PM
  2. Replies: 1
    Last Post: September 23rd, 2001, 04:12 PM
  3. phpMyAdmin backup corrupting database contents
    By mano1 in forum MySQL Help
    Replies: 5
    Last Post: September 17th, 2001, 03:26 PM
  4. Database backup
    By micklloyd in forum MySQL Help
    Replies: 4
    Last Post: June 13th, 2001, 05:09 AM
  5. Backup of Database ?
    By Gerhard in forum MySQL Help
    Replies: 7
    Last Post: February 10th, 2001, 05:38 AM

IMN logo majestic logo threadwatch logo seochat tools logo