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

How to set mysql to disable remote connections

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

Share

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

Editor to share with you how to set mysql to prohibit remote connections, I believe 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 setting forbids remote connection methods: 1, log in to the database server, specify mysql database; 2, execute [update user set host='localhost' where user='root';] statement; 3, refresh permission table.

Specific steps:

Use mysql # Open mysql database # setting host to localhost means that only local connections can be made to mysql update user set host='localhost' where user='root'; flush privileges; # refresh permissions table to make the configuration effective

If we want to open a remote connection, we can refer to the following method:

Log in first:

Mysql-u root-h localhost-puse mysql # Open mysql database # setting host to% means that any ip can connect to mysql. Of course, you can also specify host as an ipupdate user set host='%' where user='root' and host='localhost';flush privileges; # refresh permission table to make the configuration effective.

When it's done, we can connect to our mysql remotely.

The above is how to set up mysql to prohibit remote connection of all the content, 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