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

Mysql 5.7How to manage user passwords

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces how to manage user passwords in mysql 5.7.I hope I can add and update some knowledge to you. If you have any other questions you need to know, you can continue to follow my updated articles in industry information.

Database is a very important link in the information system, and it is very important to manage it reasonably and efficiently. Usually, the administrator creates different administrative accounts, then gives them different operation permissions, and gives these accounts to the corresponding managers to use.

In the mysql database, all user information is stored in the user table of the mysql library

Mysql > use mysql;mysql > show tables +-- + | Tables_in_mysql | +-+ | columns_priv | | / / some tables are omitted | | user | +- -+ 31 rows in set (0.00 sec) administrative users

Add, modify and delete users who can manage mysql by adding, modifying and deleting the user table, create new users using CREATE, delete users by DROP, and modify user passwords by SET.

Add and delete plaintext add new user create user 'zhangsan'@'localhost' identified by' 123456create a new user 'zhangsan' allow login locally (can be changed to another IP address) password is 123123 ciphertext add new user mysql > select password (' 123123') / / generate ciphertext string +-- + | password ('123123') | +-- + | * E56A114692FE0DE073F9A1DD68A00EEB9703F3F1 | + -+ 1 row in set 1 warning (0.01 sec) mysql > create user 'lisi'@'localhost' identified by password' * E56A114692FE0DE073F99A1DD6 / / create a new user to query the newly added user select user,authentication_string,host from user / / query the user, password and host data in the user table

Delete user drop user 'zhangsan'@'localhost'; user password modify use the SET command to modify the user password set password=password (' 123123'); / / modify the current login user password set password for 'lisi'@'localhost'=password (' 123456') / / the solution to modifying other users' passwords and forgetting root passwords is to first shut down the running MySQL process systemctl stop mysqld.service netstat-ntap | grep 3306 / / query less than 3306 port information indicates that the mysql process has ended killall mysqld / / * * if the normal stop command cannot shut down the process, you can use this command

Log in to mysqld-- skip-grant-tables to change your password by skipping user verification

Enter the previous command and reopen the new terminal login mysql-u root / / the new terminal login update mysql.user set authentication_string=password ('abcabc') where user='root';// change the password entry in the user table (user) flush privileges; / / refresh before you can log in to the system with the new password

Read the above about mysql 5.7 how to manage user passwords, I hope it can bring some help to you in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

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