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 database-user and password management

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

Share

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

Create user and password mysql > create user 'zhao'@'loacl' identified by' 123123 alternate MySQL > use mysql

Create ciphertext password mysql > select password ('123123'); # View ciphertext corresponding to plaintext

Mysql > create user 'test01'@'localhost' identified by # create ciphertext password' E56A114692FE0DE073F9A1DD68A00EEB9703F3F1password; delete user mysql > drop user 'test01'@'localhost'

Change the password of the existing user set password = pssword ('123123'); change the password of other users set password for 'user02'@'localhost' = password (' 123abc'); rename the user mysql > rename user 'zz'@'host' to' user01'@'host'

User authorization mysql > grant select,update on *. * to 'user01'@'localhost' identified by' 123123 permissions; # add select,update permissions to user user01 for all libraries and tables

Revoke user authorization mysql > revoke update on *. * from 'user01'@'localhost'; # revoke update rights to user01 users

The user forgot the password 1. Modify the configuration file systamctl stop mysqld.service # shut down the database vim / etc/my.cnf skip-grant-tables # insert (skip verification) systamctl start mysqld.service # at the bottom of the mysqld section to open database 2. Directly enter the database to change the password mysql # directly enter the database mysql > update mysql.user set authentication_string = passwordd ('123123'); mysql > quit3. Test login database [root@localhost data] # mysql-uroot-p123123. Omit part of the content mysql > # successfully enter mysql database

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