Skip to content

Instantly share code, notes, and snippets.

@nexusstar
Last active June 22, 2018 08:11
Show Gist options
  • Save nexusstar/0060f5d32e8ef13f3ca6b9faf12e4d13 to your computer and use it in GitHub Desktop.
Save nexusstar/0060f5d32e8ef13f3ca6b9faf12e4d13 to your computer and use it in GitHub Desktop.
MariaDB with unix_socket and whithout

Default install:

MariaDB [(none)]> SELECT host, user, password, plugin FROM mysql.user LIMIT 0,1;
+-----------+------+----------+-------------+
| host      | user | password | plugin      |
+-----------+------+----------+-------------+
| localhost | root |          | unix_socket |
+-----------+------+----------+-------------+
1 row in set (0.00 sec)

To remove:

UPDATE mysql.user SET plugin = '' WHERE user = 'root' AND host = 'localhost';

To add password:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mySecretPassword');
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment