Skip to content

Instantly share code, notes, and snippets.

@phuongtailtranminh
Last active December 5, 2016 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phuongtailtranminh/f5f2b67ce0d013b54bc5f4641560fe04 to your computer and use it in GitHub Desktop.
Save phuongtailtranminh/f5f2b67ce0d013b54bc5f4641560fe04 to your computer and use it in GitHub Desktop.
MySQL
# 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