I was resetting MYSQL Password since I forgot it. I am using MYSQL 5.6.41 at Centos 7.
I followed the following steps:
- Stop MYSQL using :
service mysql stop
- Start MYSQL in safe mode so that I can have full access without a password.
sudo mysqld_safe --skip-grant-tables &
Above command ends with :
190822 20:37:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done mysqld_safe --skip-grant-tables
- Check MYSQL status if it is running:
service mysql status
This command always shows me iactive status:
Active: inactive (dead) since Thu 2019-08-22 20:14:22 UTC; 11min ago
Since MYSQL is getting dead after running mysqld_safe, 'mysql -u root' is denying to login.
I visited many links to solve this problem even I found the same problem posted by a couple of people but that did not work in my case.
Reference :
https://linuxize.com/post/how-to-reset-a-mysql-root-password/
Can't reset root password with --skip-grant-tables on ubuntu 16
mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid prevent from server restart