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

The method of setting remote access password by mysql

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Editor to share with you the method of mysql to set remote access password, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Mysql sets the remote access password: first log in to mysql and query the user table and host permissions commands; then delete the remote access user root and update the permissions commands; finally re-create the remote operation account to authorize remote access and update permissions.

How to set remote access password by mysql:

1. Log in to mysql command: mysql-uroot-p (enter password)

2. Query user table and host permissions command:

Use mysqlselect user, host from mysql.user

Note: the% here means that any machine can connect to the server remotely through root. We can directly delete this user and redefine the user and password.

3. Delete root as a remote access user

Delete from mysql.user where user = 'root' and host ='%'

4. Update permissions command:

Flush privileges

5. Re-query the user table and host permissions as follows:

6. Recreate the remote operation account, authorize remote access and update permissions, and execute the following code in turn:

Create user 'root'@'%' identified with mysql_native_password by' 123456 grant all privileges on *. * to 'root'@'%' with grant option;flush privileges; is all the contents of mysql's method of setting remote access password. 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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report