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

View and modify the user name and password of mysql

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

First, check the password

At this point, you need to go to the / etc/mysql directory and execute sudo vi debian.cnf or sudo vimdebian.cnf to check the user name and password in it.

Then use the user name and password in this file to enter mysql

If the user name in debian.cnf is debian-sys-maint, then:

Mysql-u debian-sys-maint-p press enter, then you need to enter your password and copy the password in debian.cnf to enter the mysql database.

Change the root password

After entering the mysql client

Mysql > use mysql

Database changed

Mysql > update user set password=password ('new password') where user='root'

Query OK, 4 rows affected (0.00 sec)

Rows matched: 4 Changed: 4 Warnings: 0

Mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Mysql > quit

You can log in with your new user name and 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

Database

Wechat

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

12
Report