Last active
September 24, 2015 22:58
-
-
Save jmfederico/822650 to your computer and use it in GitHub Desktop.
MySQL quick commands!
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 --opt --password=miclave --user=miuser mibasededatos > archivo.sql | |
# BackUp to bz2 | |
mysqldump --opt --password=miclave --user=miuser mibasededatos | bzip2 -c > archivo.sql.bz2 |
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
# Start instance | |
sudo mysqld --no-defaults --port=3307 --datadir=/var/lib/mysql-bak --user=mysql --socket=/tmp/mysql-bak | |
# connect using TCP | |
mysql --port=3307 -p --protocol=TCP | |
# connect using socket | |
mysql --socket=/tmp/mysql-bak -p |
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
# Restore | |
mysql --password=miclave --user=miuser mibase < archivo.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment