Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Last active September 19, 2015 14:13
Show Gist options
  • Select an option

  • Save githubutilities/630f66ea3999451be606 to your computer and use it in GitHub Desktop.

Select an option

Save githubutilities/630f66ea3999451be606 to your computer and use it in GitHub Desktop.
MySQL CheatSheet

MySQL CheatSheet

MySQL run on external ip address

change mysql config file /etc/mysql/my.cnf

bind-address		= 0.0.0.0

Setting privilege

SHOW GRANTS [FOR user]

SHOW GRANTS FOR 'root'@'localhost';
GRANT ALL ON *.* TO 'username-here'@'%';

Reference

Login remote mysql

mysql -u root -h localhost -p

Reference

use mysql;
SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment