Tag:mysql root password
-
Find the MySQL startup profile
windows The following is My.ini, Linux under the name MY.CNF, Linux below if there is no special directory specified, then my.cnf generally stored under the/etc/directory.
2. Modify the MySQL configuration file
Locate the [mysqld] line in the configuration file, save the file after adding skip-grant-tables below and exit.
3. Restart the MySQL database
4. Reset the root password for MySQL
method One: Use "path/mysql-h hostname (your host's IP address)----root mysql" command login Record MySQL, Run command change Password:
use MySQL;
Update user set Pass Word=password (' new password ') where user= ' root ';
flush privileges;
Method Two: Use "path/mysqladmin-h hostname-u rootpassword ' new password '" To reset the root password directly.
5. Modify the MySQL configuration file again
Delete the skip-grant-tables that is added in step 2nd.
6. Restart the MySQL database again
MySQL change root password