O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To test this, you can use telnet:

shell> telnet <mysql ip> 3306# if telnet is not installed you can install it or use nc (netcat)

If telnet hangs or the connection is refused, it means that the port is closed. Please note that if you see an output like this, it means that the port is not blocked:

shell> telnet 35.186.158.188 3306Trying 35.186.158.188...Connected to 188.158.186.35.bc.googleusercontent.com.Escape character is '^]'.FHost '183.82.17.137' is not allowed to connect to this MySQL serverConnection closed by foreign host.

It means that the port is open but MySQL is restricting the access.

When creating users, avoid giving access from anywhere (the % option). Restrict access to an IP range or subdomain. Also restrict ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required