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
2
Answers
Finally, I solved it using the following link and some modifications in the commands used in it.
Resetting the Root Password: Unix and Unix-Like Systems
Modifications I did:
I used: > service mysqld stop
I used:
After search some hours without succcess, I finally find the way
When you execute
Mysql use a file in /etc/mysql/mysql.conf.d/mysqld_safe_syslog.cnf
I comment the second line, and save like this
Then I can execute the command without problems.
I have found in log /var/log/mysql/error.log
And search on internet what is this variable.
https://dba.stackexchange.com/questions/230736/mysql-could-not-be-started-because-unknown-variable-log-syslog-1