mysql-backup

Script for MySQL backup to multiple files

假装没事ソ 提交于 2019-12-11 23:15:53
问题 I am creating a script to back up the MySQL running on a Windows 2012 server, using PowerShell. Unlike other tips found here, I want to generate a .sql file for each of the databases. This post shows how to create multiple files. I adapted it to PowerShell: Get-ChildItem -Path "$($MYSQL_HOME)\data" | cmd /C "$($MYSQL_HOME)\bin\ mysql -u -s -r $($dbuser) -p$($dbpass) -e 'databases show' '| while read dbname; cmd /C "$($MYSQL_HOME)\bin\mysqldump.exe --user = $($dbuser) --password = $($dbpass) -

How to take Physical backup for non-enterprise MySQL INNODB engine

给你一囗甜甜゛ 提交于 2019-12-08 13:31:19
问题 According to documentation, if you are using MYISM, it should be possible to take physical backup of MySQL. i.e. copying data files. But in order to take "Physical Backup" for INNODB Engine, you need MysqlEnterprise. I am not using MySQL Enterprise at the moment and have Database of size 100GB. I do not want to use mysqldump but want to do a physical backup. Is there a way to achieve this ? 回答1: Percona XtraBackup is free and open-source, and works with free, open-source distributions of

Export and Import all MySQL databases at one time

 ̄綄美尐妖づ 提交于 2019-11-26 21:12:42
I want to keep a backup of all my MySQL databases. I have more than 100 MySQL databases. I want to export all of them at the same time and again import all of them into my MySQL server at one time. How can I do that? Shakti Singh Export: mysqldump -u root -p --all-databases > alldb.sql Look up the documentation for mysqldump . You may want to use some of the options mentioned in comments: mysqldump -u root -p --opt --all-databases > alldb.sql mysqldump -u root -p --all-databases --skip-lock-tables > alldb.sql Import: mysql -u root -p < alldb.sql jruzafa Other solution: It backs up each

Export and Import all MySQL databases at one time

久未见 提交于 2019-11-26 08:38:39
问题 I want to keep a backup of all my MySQL databases. I have more than 100 MySQL databases. I want to export all of them at the same time and again import all of them into my MySQL server at one time. How can I do that? 回答1: Export: mysqldump -u root -p --all-databases > alldb.sql Look up the documentation for mysqldump. You may want to use some of the options mentioned in comments: mysqldump -u root -p --opt --all-databases > alldb.sql mysqldump -u root -p --all-databases --skip-lock-tables >

Automated or regular backup of mysql data

霸气de小男生 提交于 2019-11-25 23:19:03
问题 I want to take regular backups of some tables in my mysql database using <insert favorite PHP framework here> / plain php / my second favorite language. I want it to be automated so that the backup can be restored later on in case something goes wrong. I tried executing a query and saving the results to a file. Ended up with code that looks somewhat like this. $sql = \'SELECT * FROM my_table ORDER id DESC\'; $result = mysqli_query( $connect, $sql ); if( mysqli_num_rows( $result ) > 0){