So I have two AWS servers in question, one is running MariaDB and the other is my API server (python based). I can connect just fine locally on the MariaDB server as well as my dev computer. I cannot connect from the API server nor a third AWS server.
netstat output
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:mysql *:* LISTEN 1363/mysqld
ngrep on API server shows
interface: eth0 (10.[api ip]/255.255.255.0)
filter: (ip or ip6) and ( port 3306 )
##########
ngrep on Maria Server
interface: eth0 ([maria ip]/255.255.255.0)
filter: (ip or ip6) and ( port 3306 )
####
T [maria ip]:3306 -> [dev ip]:2392 [AP]
[redacted]
##
T [dev ip]:2392 -> [maria ip]:3306 [AP]
[redacted]
##
T [maria ip]:3306 -> [dev ip]:2392 [AP]
[redacted]
#######################
Eventually I get this error
ERROR 2003 (HY000): Can't connect to MySQL server on '[maria ip]' (110 "Connection timed out")
or from my python script
Exception happened during processing of request from ('127.0.0.1', 50110)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Before somebody mentions it, my IP tables are set correctly and AWS SecGrps are not the issue either.
This is not a duplicate of Trying to connect to remote MySQL host (error 2003) as (1) there are no (logical) devices between the server, (2) I can connect from my Dev station on the other side of the country, and (3) none of the "fixes" worked.
Also I can connect from API script to Redis Server running on my maria server.