Helpful Information
 
 
Category: Web Hosting
backing up my MySQL database

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!

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.










privacy (GDPR)