Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Last active August 29, 2015 14:09
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 nanusdad/28b52967b321339e33c2 to your computer and use it in GitHub Desktop.
Save nanusdad/28b52967b321339e33c2 to your computer and use it in GitHub Desktop.
MySQL user creation / secure_auth errors
mysql> create user 'user'@'host_fqdn_or_ip' identified by 'secret_password';
Query OK, 0 rows affected (0.07 sec)
mysql> grant select on database_name.* to 'user'@'host_fqdn_or_ip';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
mysql> set session old_passwords=0; set password for 'user'@'host_fqdn_or_ip' = password('secret_password');
Last command is neeed if client errors out with authentication problems ( client option secure_auth enabled )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment