Answer the question
In order to leave comments, you need to log in
Restoring root in mysql?
Unknown MySQL root password
trying to recover by running MySQL without checking privileges
Here is the log
[email protected]***-**-**:~# /etc/init.d/mysql stop
[ ok ] Stopping mysql (via systemctl): mysql.service.
[email protected]***-**-**:~# mysqld_safe --skip-grant-tables &
[1] 5751
[email protected]***-**-**:~# 170922 22:33:02 mysqld_safe Logging to syslog.
170922 22:33:02 mysqld_safe A mysqld process already exists
[email protected]***-**-**:~# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[1]+ Exit 1 mysqld_safe --skip-grant-tables
[email protected]***-**-**:~#
Answer the question
In order to leave comments, you need to log in
Log in as the server root, then type the following commands:
/etc/init.d/mysql stop
/etc/init.d/mysql start --skip-grant-tables
mysqladmin -u root password "newpassword"
/etc/init.d/mysql stop
/etc/init.d/mysql start
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question