How to Set Root Password to Null in MySQL Command Line Client
To change the root user password to null from the MySQL command line client, you can follow these steps:
- Connect to the MySQL command line client as the root user.
- Execute the following SQL statement to reset the root password to null:
use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
- If the 'plugin' field is set to 'auth_socket', you also need to update it to 'mysql_native_password'.
- You can now connect to the MySQL server as the root user without a password.
The above is the detailed content of How to Set the Root Password to Null in MySQL?. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn