Home  >  Article  >  Database  >  How to Set the Root Password to Null in MySQL?

How to Set the Root Password to Null in MySQL?

Linda Hamilton
Linda HamiltonOriginal
2024-10-31 09:59:29413browse

How to Set the Root Password to Null in MySQL?

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:

  1. Connect to the MySQL command line client as the root user.
  2. 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';
  1. If the 'plugin' field is set to 'auth_socket', you also need to update it to 'mysql_native_password'.
  2. 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