Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i backup a mysql database

Status
Not open for further replies.

fgeorge

Programmer
Jun 28, 2002
76
NG
i want to back up a mysql database in order to re-create it on another system.
how may i do this?
 
Go into your mysql directory.. you'll find a subdirectory called data, then subdirectories within there each named whatever your database name is. Just copy those subdirectories. I would stop the MYSQL service (on windows, not sure what the Linux equivalent is) before doing this of course.

-Rob
 
If you export from windoz version to linux version than you will have problems with all tables set to `read only` and if you are using InnoDB tables then you need to copy settings from my.ini or my.cnf as well (as from MySQL manual).

It is much better to run


/mysqldump -u root -ppassword DBname > /path/filename.sql


Then on the other side, create an empty DB with the same name and log in importing the .sql file you have generated


/mysql -u root -ppassword DBname < /path/filename.sql


Bye


Qatqat

I have been happy throughout my life in thinking that samba was I kind of dance; now I live with Linux and all I do is working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top