pengyuyan1222's picture
Create test.py
a634eaf verified
Raw History Blame Contribute Delete
243 Bytes
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(("rm-wz9dh38emx9o7w0jnmo.mysql.rds.aliyuncs.com", 3306))
if result == 0:
print("Port is open")
else:
print("Port is closed or unreachable")