Last active
August 29, 2015 14:27
Revisions
-
rolandovillca revised this gist
Aug 19, 2015 . No changes.There are no files selected for viewing
-
rolandovillca revised this gist
Aug 19, 2015 . No changes.There are no files selected for viewing
-
rolandovillca revised this gist
Aug 18, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # SEARCH TABLE NAME: SHOW TABLES FROM master LIKE '%table_name%'; # CHECK MYSQL CONF: cat /etc/my.cnf -
rolandovillca revised this gist
Aug 12, 2015 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,15 @@ # CHECK MYSQL CONF: cat /etc/my.cnf # BACKUP SINGLE DATABASE: mysqldump -u username -p database_to_backup > backup_name.sql # RESTORE SINGLE DATABASE: # To restore a database dump created with mysqldump, you simply have to redirect the file into MySQL again. # Create a blank database, then redirect the dump file. mysql -u username -p database_name < backup_name.sql # BACKUP MULTIPLE DATABASES: sudo mysqldump -uroot --all-databases > my_directory/all-databases.sql mysqldump -uroot -ppassword --all-databases | gzip > /home/backupdir/db.sql.gz -
rolandovillca revised this gist
Aug 12, 2015 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ # CHECK MYSQL CONF: cat /etc/my.cnf # MAKE BACKUP DATABASES: sudo mysqldump -uroot --all-databases > my_directory/all-databases.sql mysqldump -uroot -ppassword --all-databases | gzip > /home/backupdir/db.sql.gz database=`mysql --user=<enter username> --password=<enter password> -e "SHOW DATABASES"` for db in $database; do echo "$db" -
rolandovillca renamed this gist
Aug 12, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rolandovillca created this gist
Aug 12, 2015 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ database=`mysql --user=<enter username> --password=<enter password> -e "SHOW DATABASES"` for db in $database; do echo "$db" mysqldump --user="<enter username>" --password="<enter password>" --databases "$db" > <path_to_store_your_database>/"$db".sql gzip "$db" done