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

How to Set the Root Password to Null in MySQL?

Linda Hamilton
Release: 2024-10-31 09:59:29
Original
535 people have browsed it

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';
Copy after login
  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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template