I want to allow remote MySQL connections so that any IP can log in as the root user. How would I go about doing this?
Asked
Active
Viewed 227 times
0
-
1It's very insecure – Jsowa Jun 24 '20 at 04:40
-
Why is it insecure? – Obi-Wan-Kenobi Jun 24 '20 at 04:47
-
1Because you want to expose your database to any IP address as root. There should be only set of allowed IPs. – Jsowa Jun 24 '20 at 04:50
-
But if there's a strong password they won't be able to connect anyway – Obi-Wan-Kenobi Jun 24 '20 at 04:52
-
1That's bad assumption. Password can be stolen – Jsowa Jun 24 '20 at 04:54
-
Okay but they can just steal the password for the other user too – Obi-Wan-Kenobi Jun 24 '20 at 06:29
-
That's why cyber security doesn't rely only on the passwords. Explain in answer more about your problem and you will get better answer. – Jsowa Jun 24 '20 at 06:37
-
Please visit this quesions https://stackoverflow.com/questions/42862058/how-to-set-mysql-grant-to-allow-external-connection-to-mysql – Stathis Alexopoulos Jun 24 '20 at 06:48
1 Answers
0
Try it:
use mysql;
update user set host='%' where host='localhost'

Trần Hữu Hiền
- 872
- 1
- 9
- 22
-
4While this code may resolve the OP's issue, it is best to include an explanation as to how your code addresses the OP's issue. In this way, future visitors can learn from your post, and apply it to their own code. SO is not a coding service, but a resource for knowledge. Also, high quality, complete answers are more likely to be upvoted. These features, along with the requirement that all posts are self-contained, are some of the strengths of SO as a platform, that differentiates it from forums. You can edit to add additional info &/or to supplement your explanations with source documentation. – ysf Jun 24 '20 at 08:25