January 13th, 2013, 04:36 PM
How to back up database?
Hi. My web hosting provide will charge me extra money if I want to do backup to my mysql database. My size of my db is very small but I've alot of tables though.
What's the best way to backup my database schema and data in a way so I can easily restore to a different server from scatch?
Can you tell me not only how to backup and also how to restore from the backup?
I don't have like a backup drive or tape. So it has to be something easy to do.
January 13th, 2013, 09:26 PM
i use heidisql, which is a windows based desktop utility program, that connects my computer to my internet service provider's mysql database
backups and restores are trivially easy
January 13th, 2013, 11:16 PM
How to backup database?
The best way to backup & restore MySQL database is by using mysqldump command. Following is the command to backup a single database:
mysqldump -u root -p[root password] [database_name] > backupfilename.sql
To restore MySQL database you first need to create an empty database and then use below command:
mysql -u root -p[root password] [database_ name1]< databasename.sql
Above command will restore the database_name1 file to databasename.sql.
To know more about this command you can search on Google by typing “MySQL backup commands”.
January 14th, 2013, 12:27 AM
please explain to beebac exactly how to do this on a remote server belonging to the web hosting provider, and where exactly on the server the backup file will be created
Originally Posted by diawilliam
January 19th, 2013, 11:34 AM
The solution suggested by diawilliam is the best, because a backup solution should be reliable even when network does not work or is too slow.
But the "right solution" can only be done if the hoster provides you a remote access to the command line.
If so, just check mysql.com manual for mysqldump and Linux man page for cron.
The reason why I think that this solution is better is that I think that your provider keeps the db and your site files on different machines. So if a machine burn, hopefully the other one will not. But it would be better to have a local script which daly downloads the latest backup.