In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to change the MySQL database user password", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to change the MySQL database user password" this article.
One: directly use the mysqladmin command to modify the root user password
1): if the root user does not have a password,
Mysqladmin-u root password newpassword
2): if the root user already has a password,
Mysqladmin-u root-poldpassword password newpassword
Second, log in to the database to change the root password
The root user password is stored in the user of mysql in the mysql database and can be modified according to the following statement: (this modification method, the password is saved in plaintext, cannot be logged in, and the actual modification is invalid)
Update mysql.user set password='newpassword' where user='username'
Flush privileges
Third: the method of using set password
Set password for username@'localhost' = password ('newpassword')
Four: the method of using grant privileges
Grant all privileges on *. * to 'username'@'%' identified by' newpassword'
Flush privileges
Add: change root password when you forget root password
If you forget the root password, you can use the following methods to change the root password:
1): close the mysql database
2): start the mysql database by skipping permission detection
/ usr/local/mysql/bin/mysqld_safe-skip-grant-tables &
3): reset the root password
Set password for 'username'@'localhost' = password (' newpassword')
Flush privileges
4): close mysql and start mysql normally
The above is all the contents of the article "how to change the user password of MySQL database". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.