Mysql to retrieve the root password, modify the root password 1, close the mysql service killall-TERMmysqld2, modify the configuration file vietcmy. cnf adds the following sentence to the [mysqld] section: skip-grant-tables for example: [mysqld] datadirvarlibmysqlsocketvarlibmysqlmysql. s
Retrieve the root password of mysql ================================== modify the root password 1. Disable the mysql service killall -TERM mysqld 2. modify the configuration file vi/etc/my. cnf adds the following sentence to the [mysqld] section: skip-grant-tables for example: [mysqld] datadir =/var/lib/mysql socket =/var/lib/mysql. s
Retrieve the root password of mysql
=========================================, Change the root password
1. Disable the mysql service.
Killall-TERM mysqld
2. modify the configuration file
Vi/etc/my. cnf
In the [mysqld] section, add skip-grant-tables.
For example:
[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
Skip-grant-tables
3. Restart mysqld
Service mysqld restart
4. log on
Mysql-uroot-p
5. Change the password
Update mysql. user set password = PASSWORD ('000000') where user = 'root ';
Flush privileges; // refresh the permission
=========================================, Change the root password
1. modify the configuration file
Vi/etc/my. cnf
Remove previous changes
2. Restart the service
3. Set remote users