Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Login problem of empty password after changing login password in partial version of mariadb database

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The problem that Mariadb database can login with empty password after changing password

Now that you can find this article, I believe you will have some understanding of the data, and I will not repeat the basic knowledge of this database, but here I will give a little explanation to the problem that "the database can log in with an empty password after changing the password and executing the flush privileges command."

When I install the mariadb database, the default password is an empty password. For the sake of safety, you can set a strong secret.

Recurrence problem

MariaDB version: 10.0.36

1. Set the password

Update user set password=password ("password") where user= "root"

Check the password after setting.

As you can see, the password setting is complete, and we have executed the flush privileges command to refresh it. Note that the failure of some friends to execute this command after changing the password will also cause the old password to be used next time (public answer, but it won't solve my problem).

2. Log out and log back in

Log back in to the database

Mysql-u root-p or mysql command

See, you can log in to the database without using a password, and the password you just set is useless. Why is that? It was only after looking up a lot of information that I thought it might be the version of the database.

3. Solve the problem

Since version 5.5.7, plugin has been introduced into the mysql database to authenticate users' passwords, while the default plug-in installed by mariaDB is' console' or 'unix_socket',. This plugin allows you to log in from the console without a password and disable password authentication. And you cannot connect from other clients

Execute in the database mysql

Select user,password,plugins from user

Solving this problem is simple, as long as you leave Plugin empty.

Update user set plugin='' where user='root'

Log in again and you will be asked to enter the password!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report