Topic 59 : How to reset MySQL root password on your Linux server ( hướng dẫn reset password mysql trên linux )

40

# service mysql stop

# mkdir -p /var/run/mysqld

# chown mysql:mysql /var/run/mysqld

# /usr/sbin/mysqld –skip-grant-tables –skip-networking &

# mysql -u root

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected, 6 warnings (0.02 sec)

mysql>

mysql> SET PASSWORD FOR [email protected]’localhost’ = PASSWORD(‘newpassword’);

Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> quit

Bye

/usr/sbin/mysqld –skip-grant-tables –skip-networking

service mysql start

mysql -u root -p