unable to reset mysql 'root' password

Rajadip

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 ?

Rajadip

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unable to set password for root@localhost in mysql

From Dev

How to reset the forgotten MySQL root password?

From Dev

How to reset mysql password

From Dev

reset/change mysql root password

From Dev

Unable to reset mysql password for my Ubuntu machine

From Dev

failed to reset root password for gitlab

From Dev

Reset MySQL root password not working

From Dev

How to reset password for root in arangodb?

From Dev

Unable to log in and unable to reset the password

From Dev

Unable to reset MySQL root password, tried everthing

From Dev

Unable to reset MySQL root password, tried everthing

From Dev

WAMP - Reset Root password on mysql

From Dev

unable to reset root password of mysql

From Dev

Problem with mysql root password

From Dev

MySql root password reset

From Dev

Can't start MySQL to reset root password

From Dev

Unable to set password for root@localhost in mysql

From Dev

Trying to reset forgotten MySql Root Password

From Dev

Can't reset MySQL (MariaDB) root password

From Dev

How do I reset mysql's root password?

From Dev

Change MySql root password

From Dev

failed to reset root password for gitlab

From Dev

Reset Mysql workbench root password

From Dev

setting a mysql root password

From Dev

Is there a way to retrieve a root mysql password (no reset)

From Dev

MySQL damaged, unable to login to connect and root password is no longer working

From Dev

Reset Root Password for MySQL via Package Configuration

From Dev

Reset MySQL root password not working

From Dev

Reset root password for Ubuntu 16.04 - recovery mode asks for root password