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

What is the user management of MySQL?

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

Share

Shulou(Shulou.com)05/31 Report--

MySQL user management is how, for this problem, this article details the corresponding analysis and solution, hoping to help more small partners who want to solve this problem find a simpler and easier way.

One security policy after mysql installation is to delete null users and users whose host is not localhost

1. Delete empty user

Delete empty user

mysql> select mysql.user,host,password from user whereuser =''; query user

mysql> delete from user where user=''; #delete user= null

Remove users whose host is not equal to localhost

mysql> select user,host,password from user where host!= 'localhost';

mysql>delete from user where host!= 'localhost';

2. Set password for user

mysql> update user set password=password(123456);

mysql>flush privileges;

Create mysql users and grant user privileges

1. Create user and set password

mysql>create user acbuf@'localhost' identified by'123456';

mysql>create user acbuf@'localhost';

2. Common methods of creating users; creating users and authorizing grants at the same time

mysql> grant all on blog.* to 'acbuf'@'localhost' identified by '123456'; #blog library not automatically created

3. Authorize libraries for existing users.

mysql> grant all on blog.* to acbuf@'localhost';

4. View User Rights

mysql>show grants for acbuf@'localhost';

5.root Password Forgot to reset password

1. Edit/etc/my.cnf to add skip-grant-tables to the [mysqld] section and restart mysqld.

Then mysql can enter, and then update to set the password for root

After setting, delete the added skip-grant-tables and restart.

2. [root@test /]# mysqld_safe--skip-grant-tables --user=mysql &

The next steps are the same as the first method.

About MySQL user management is how the answer to the problem shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

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