Last active
December 5, 2016 14:54
-
-
Save phuongtailtranminh/f5f2b67ce0d013b54bc5f4641560fe04 to your computer and use it in GitHub Desktop.
MySQL
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 characters
# Fix mysqld start fail: (when backup server) | |
vim /etc/mysql/my.cnf --> | |
[mysqld] | |
innodb_force_recovery = 3 | |
# Backup: | |
mysqldump -u root -p[password] [database_name] > dumpfilename.sql | |
# Restore: | |
mysql -u root -p[password] [database_name] < dumpfilename.sql | |
# Create user | |
CREATE USER 'finley'@'localhost' IDENTIFIED BY 'some_pass'; | |
# Grant Privileges on Database | |
grant all privileges on mydb.* to myuser@localhost identified by 'mypasswd'; | |
# Disable foreign key checks | |
SET foreign_key_checks = 0; | |
# Enable foreign key checks | |
SET foreign_key_checks = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment