I have installed mysql 5.7.18. After installation the password of root
user is null
. I have tried mysql_secure_instattation
and following queries to reset ther password.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyPassword';
and
UPDATE mysql.user
SET authentication_string = PASSWORD('MyPassword'), password_expired = 'N'
WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;
These methods executed successfully but still mysql root user is connecting NULL
password. What should I do ?
This is due to,MySQL is using unix_socket
plugin instead of mysql_native_password
plugin for root user which means mysql trusts the credentials of Linux root user. If you are loggied in with linux root user, MySQL won't ask for saperate credentials for MySQL root user. Hence even after changing password successfully for MySQL root user, it was connecting with No password.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments