Skip to main content

Posts

Showing posts with the label MySQL reset root user password

MySQL reset root user password

MySQL reset root user password: Check MySQL status: strace -e stat64 mysqld --print-defaults > /dev/null When you don't know mysql user password and would like to reset password: https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html # service mysql stop # mysqld_safe --skip-grant-tables & # mysql -u root mysql> show databases; mysql> use mysql mysql> UPDATE mysql.user SET authentication_string = PASSWORD('mysql'), password_expired = 'N' WHERE User = 'root' AND Host = 'localhost'; mysql> flush privileges; mysql> quit # service mysql stop # service mysql start Get temporary password for mysql user root, after installation: # grep 'temporary password' /var/log/mysqld.log [Server] A temporary password is generated for root@localhost: #=lkkq7kpuFj $ mysql -u root -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.11 Copyright (c) 200...