Hi, I need a good MySQL script that logs in to mysql DB and reads out all DB to a txt file, that tha script goes in and make a backup on every DB it finds in that txt files. This becase that users/customers delete/add DB during the day Maybe someone already have a script like this and like to share? i will do some research and get back with more information, feel free to help me =) //M
http://www.howtoforge.com/how-to-back-up-mysql-databases-with-mylvmbackup-on-ubuntu-8.10 http://www.howtoforge.com/shell-scr...n-an-individual-file-and-upload-to-remote-ftp http://www.howtoforge.com/mysql-backups-with-zrm-2.0 http://www.howtoforge.com/back_up_mysql_dbs_without_interruptions
If you want real MySQL backup, and not to worry anymore, you should take a look at ZRM for MySQL (Zmanda Recovery Manager for MySQL). It is open source and also available with support contracts. http://www.zmanda.com/backup-mysql.html
Is you only have a few databases you can use the backup mysql function in Webmin. It writes the databases to .sql files or you can tar it. I do the backup every hour on the server, en sync it to my home pc every day and weekly with SyncBack.
Solution! Hi found the solution i was asking about earlier =) make a mysql.sh that you need to logon to mysql shell: /usr/bin/mysql -h localhost -u root -pYourePasswd < list.sh And make list.sh and put: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA INTO OUTFILE 'db-list'; then you can find it under "/var/lib/mysql/db-list" My next part is to use the list i got whit all DB in my mysql server to make a individuel backup of all databases. plz help =) /regards Marcus
if you use the script I mentioned in my previous reply you can backup every db without doing difficult things
I using this script, that is most simply backup script i ever find MySQL Backup Script # VER. 2.5 - http://sourceforge.net/projects/automysqlbackup/ just set root password DBNAMES="all" BACKUPDIR="/opt/mysql_backups" MAILADDR="[email protected]" put link into cron.daily and you have daily monthly weekly backup backups can be send to remote ftp server.
I made this one, works greate but i now need to backup induvidual DB so i dont need to restore all DB if one failed. ##### DB Backup ##### /usr/bin/mysqldump -h localhost -u root -pDBpasswd -c --add-drop-table --add-locks --all --quick --lock-tab les --all-databases > /root/database/sqldump-`date +%Y%m%d`.sql #### FTP to Backup Server #### cd /root/database HOST='192.168.250.10' USER='ftpuser' PASSWD='passwd' ftp -n -v $HOST <<END ascii user $USER $PASSWD prompt mput *.sql bye END It´s prety clear what this script does =) //Marcus
Try automysqlbackup in my post this will made dump per database, is realy simple to use. I using it in my production enviroment.