Open the MySQL client (base) ➜ ~ mysql -uroot -ppassword Remove the skip-grant-tables from my.cnf (base) ➜ ~ sudo emacs /etc/mysql//mysqld.cnf Mysql> update user set plugin="mysql_native_password" Query OK, 1 row affected, 1 warning (0.00 sec) Mysql> update er set authentication_string=password('newpass') where user='root' and Host ='localhost' You can turn off this feature to get a quicker startup with -A ![]() Reading table information for completion of table and column names Type '\c' to clear the current input statement. ![]() Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and/or itsĪffiliates. Reset the password (base) ➜ ~ sudo service mysql stop Your new password is in the database for user 'root' Īdd the skip-grant-tables to the end of file mysqld.cnfĬopy the my.cnf file sudo cp /etc/mysql//mysqld.cnf /etc/mysql/my.cnf ALTER USER IDENTIFIED WITH mysql_native_password BY 'new-password' | validate_password.special_char_count | 0 |Īnd now you can write your password, four or more only letters. SET GLOBAL validate_password.special_char_count=0 SET GLOBAL validate_password.number_count=0 | validate_password.special_char_count | 1 | | validate_password.mixed_case_count | 1 | | validate_password.check_user_name | ON | SHOW VARIABLES LIKE 'validate_password%' There isn’t any need for the "UPDATE user SET plugin" step.įor the 8.0.4 default authentication plugin update, see MySQL 8.0.4: New Default Authentication Plugin: caching_sha2_password. The new 'YOUR_SYSTEM_USER' will have this authentication plugin and you can log in from the Bash shell now with "mysql -u YOUR_SYSTEM_USER -p" and provide the password for this user on the prompt. One change as of MySQL 8.0.4 is that the new default authentication plugin is 'caching_sha2_password'. However, the steps above should help you to understand the issue. I don't have a system setup with MySQL 8.x.x to test this. ![]() Note: On some systems (e.g., Debian 9 (Stretch)) the 'auth_socket' plugin is called 'unix_socket', so the corresponding SQL command should be: UPDATE user SET plugin='unix_socket' WHERE User='YOUR_SYSTEM_USER' įrom andy's comment it seems that MySQL 8.x.x updated/replaced the auth_socket for caching_sha2_password. Remember that if you use option #2 you'll have to connect to MySQL as your system username ( mysql -u YOUR_SYSTEM_USER). Mysql> GRANT ALL PRIVILEGES ON *.* TO UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER' Mysql> CREATE USER IDENTIFIED BY 'YOUR_PASSWD' Option 2: (replace YOUR_SYSTEM_USER with the username you have) sudo mysql -u root # I had to use "sudo" since it was a new installation Mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root' Option 1: sudo mysql -u root # I had to use "sudo" since it was a new installation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |