Created
September 5, 2009 22:45
-
-
Save spnkr/181536 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 characters
backup: | |
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql] | |
compress: | |
mysqldump --all-databases | gzip >databasebackup.sql.gz | |
restore: | |
mysql -u [username] -p [password] [database_to_restore] < [backupfile] | |
restore from archive: | |
gunzip < custback.sql.sql.gz | mysql -u [username] -p [password] [database_to_restore] | |
grant user permissions | |
GRANT ALL PRIVILEGES ON mydatabase.* TO bob@localhost IDENTIFIED BY 'fruitfly'; | |
INSERT IGNORE INTO new_tbl SELECT * FROM orig_tbl; | |
CREATE TABLE new_tbl SELECT * FROM orig_tbl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment