PDA

View Full Version : backing up my MySQL database



sacexpat
05-26-2003, 11:20 AM
I would like to back up my mysql database somewhere were I can retrieve it and download it to my home computer (for example, into my www folder, for access via ftp) for safe keeping.

I know one method to do this is
> BACKUP TABLE tablename,tablename1,... TO /path/to/directory

The problem is, I don't know what to put in /path/ because I'm not exactly sure where my database is housed at WestHost. Any ideas?

Is there a better way to do backups?

I suspect phpadmin would help me do this but I don't have it due to space issues. I need a command line (or php script) solution.

Thanks!

kassad
05-26-2003, 12:12 PM
I usually do it with mysqldump from the command line, like this:

mysqldump -c -u username -p databasename >dbbackup.sql

It should prompt you for the password and done. If you want more info, just do a 'man mysqldump', but it's pretty straightforward anyway.