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

How does mysql change the root password?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The root password can be modified in a variety of situations. Details are as follows:

Before setting the root password:

The method of the SET PASSWORD command:

Mysql-u rootmysql > SET PASSWORD FOR 'root'@'localhost' = PASSWORD (' password you want to set')

The method of the mysqladmin command:

Mysqladmin-u root password "password you want to set"

Edit the user table directly by UPDATE:

Mysql-u rootmysql > USE mysql;mysql > UPDATE user SET Password = PASSWORD ('password you want to set') WHERE user = 'root';mysql > FLUSH PRIVILEGES

After setting up root:

The way of mysqladmin:

Mysqladmin-u root password oldpass "the new password you want to set"

Set the root password, but forgot:

Mysqld_safe-- skip-grant-tables&mysql-u root mysqlmysql > UPDATE user SET password = PASSWORD ("the new password you want to set") WHERE user = 'root'; mysql > FLUSH PRIVILEGES

These are the details of various ways for mysql to modify root password. Please pay attention to other related articles for more information.

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

Database

Wechat

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

12
Report