In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "Linux environment mysql root password forgot how to do", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Linux environment mysql root password forgot how to do" it!
The method of changing password is more or less the same with different versions of mysql, but there are some differences:
Mysql5.1
1. First make sure that the server is in a secure state, that is, no one can connect to the MySQL database at will.
2. Modify the login settings of MySQL:
# vi / etc/my.cnf
Add a sentence to the paragraph of [mysqld]: skip-grant-tables saves and exits
3. Restart mysqld service mysqld restart
4. Log in and change the root password of MySQL
Mysql > USE mysql
Mysql > UPDATE user SET Password = password ('new-password') WHERE User =' root'
Mysql > flush privileges
Mysql > quit
5. Modify the login settings of MySQL
# vi / etc/my.cnf
Delete the skip-grant-tables just added in the paragraph of [mysqld]
6. Restart mysqld
# / etc/init.d/mysqld restart (service mysqld restart)
Mysql5.7
1. Stop the database: service mysql stop
two。 Run: # mysqld_safe-- skip-grant-tables &
3. Login database: mysql-p
4. Change the password: mysql > update mysql.user set authentication_string=password ('123qwe') where user='root' and Host =' localhost'
But here's a hint: there is no password in the user table in the new version of the database.
Instead, the encrypted user password is stored under the authentication_string field.
Flush privileges
Quit
5. Restart mysql: service mysql restart
But at this time the operation seems to be not fully functional, but also alter user …
Mysql > alter user 'root'@localhost' identified by' 123456'
Thank you for reading, the above is the content of "the root password of mysql under the Linux environment forgot how to do". After the study of this article, I believe you have a deeper understanding of the problem that the root password of mysql under the Linux environment has forgotten how to do it, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.