I have been trying to reset the root password of MySQL.
I have used to two methods to reset. But I didnt get it.
Following steps are done, But it doesn\'t wo
Below is the process to reset the root user password, when we forgot the root user password or missed to recollect the password provided during installation.
OS - Ubuntu 16.04
MySQL - 5.7
sudo /etc/init.d/mysql stopsudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqldsudo mysqld_safe --skip-grant-tables &mysql -uroot
mysql>use mysql;
mysql>update user set authentication_string=password('root123') where user='root';
mysql>update user set plugin="mysql_native_password" where User='root';
mysql>flush privileges;
quit;
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
mysql -uroot -proot123PFB, the URLs for reference.
https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/ mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists MySQL user DB does not have password columns - Installing MySQL on OSX MySQL fails on: mysql "ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded"