MySQL Remote connection not succeeding

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to connect to a MySQL db remotely for about 10 hours with no luck.



The server is running Debian.



The my.cnf is configured correctly with bind-ip 0.0.0.0 and no skip-networking.



lsof -i :3306 shows an established connection from the connecting IP to the server, but then dies off.



When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it:



10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0



The user connecting is granted all access from %.



I don't know what more to do. The server is running ISPConfig with bastille firewall but even with it off nothing works. I am able to connect to the db locally and LAN addresses.



This is what I get when I'm trying to connect to the db server:



"ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"



my.cnf



skip_name_resolve is on



bind address commented



Any clues?










share|improve this question



















  • 1




    From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
    – DopeGhoti
    Oct 2 '17 at 18:41










  • The command executes without any return with the correct address.
    – Andreas Winkler
    Oct 2 '17 at 19:03










  • With what exit code?
    – DopeGhoti
    Oct 2 '17 at 19:04










  • No exit code at all
    – Andreas Winkler
    Oct 2 '17 at 19:24






  • 2




    Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
    – DopeGhoti
    Oct 2 '17 at 21:15














up vote
0
down vote

favorite












I'm trying to connect to a MySQL db remotely for about 10 hours with no luck.



The server is running Debian.



The my.cnf is configured correctly with bind-ip 0.0.0.0 and no skip-networking.



lsof -i :3306 shows an established connection from the connecting IP to the server, but then dies off.



When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it:



10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0



The user connecting is granted all access from %.



I don't know what more to do. The server is running ISPConfig with bastille firewall but even with it off nothing works. I am able to connect to the db locally and LAN addresses.



This is what I get when I'm trying to connect to the db server:



"ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"



my.cnf



skip_name_resolve is on



bind address commented



Any clues?










share|improve this question



















  • 1




    From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
    – DopeGhoti
    Oct 2 '17 at 18:41










  • The command executes without any return with the correct address.
    – Andreas Winkler
    Oct 2 '17 at 19:03










  • With what exit code?
    – DopeGhoti
    Oct 2 '17 at 19:04










  • No exit code at all
    – Andreas Winkler
    Oct 2 '17 at 19:24






  • 2




    Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
    – DopeGhoti
    Oct 2 '17 at 21:15












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to connect to a MySQL db remotely for about 10 hours with no luck.



The server is running Debian.



The my.cnf is configured correctly with bind-ip 0.0.0.0 and no skip-networking.



lsof -i :3306 shows an established connection from the connecting IP to the server, but then dies off.



When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it:



10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0



The user connecting is granted all access from %.



I don't know what more to do. The server is running ISPConfig with bastille firewall but even with it off nothing works. I am able to connect to the db locally and LAN addresses.



This is what I get when I'm trying to connect to the db server:



"ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"



my.cnf



skip_name_resolve is on



bind address commented



Any clues?










share|improve this question















I'm trying to connect to a MySQL db remotely for about 10 hours with no luck.



The server is running Debian.



The my.cnf is configured correctly with bind-ip 0.0.0.0 and no skip-networking.



lsof -i :3306 shows an established connection from the connecting IP to the server, but then dies off.



When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it:



10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0



The user connecting is granted all access from %.



I don't know what more to do. The server is running ISPConfig with bastille firewall but even with it off nothing works. I am able to connect to the db locally and LAN addresses.



This is what I get when I'm trying to connect to the db server:



"ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"



my.cnf



skip_name_resolve is on



bind address commented



Any clues?







debian mysql remote






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 3 '17 at 13:19

























asked Oct 2 '17 at 18:20









Andreas Winkler

13




13







  • 1




    From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
    – DopeGhoti
    Oct 2 '17 at 18:41










  • The command executes without any return with the correct address.
    – Andreas Winkler
    Oct 2 '17 at 19:03










  • With what exit code?
    – DopeGhoti
    Oct 2 '17 at 19:04










  • No exit code at all
    – Andreas Winkler
    Oct 2 '17 at 19:24






  • 2




    Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
    – DopeGhoti
    Oct 2 '17 at 21:15












  • 1




    From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
    – DopeGhoti
    Oct 2 '17 at 18:41










  • The command executes without any return with the correct address.
    – Andreas Winkler
    Oct 2 '17 at 19:03










  • With what exit code?
    – DopeGhoti
    Oct 2 '17 at 19:04










  • No exit code at all
    – Andreas Winkler
    Oct 2 '17 at 19:24






  • 2




    Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
    – DopeGhoti
    Oct 2 '17 at 21:15







1




1




From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
– DopeGhoti
Oct 2 '17 at 18:41




From a remote host, are you able to nc -z -w 2 dbhost.example.com 3306 successfully?
– DopeGhoti
Oct 2 '17 at 18:41












The command executes without any return with the correct address.
– Andreas Winkler
Oct 2 '17 at 19:03




The command executes without any return with the correct address.
– Andreas Winkler
Oct 2 '17 at 19:03












With what exit code?
– DopeGhoti
Oct 2 '17 at 19:04




With what exit code?
– DopeGhoti
Oct 2 '17 at 19:04












No exit code at all
– Andreas Winkler
Oct 2 '17 at 19:24




No exit code at all
– Andreas Winkler
Oct 2 '17 at 19:24




2




2




Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
– DopeGhoti
Oct 2 '17 at 21:15




Not possible. All programs return an exit code upon exit. Re-run the command, and follow it up with echo $?.
– DopeGhoti
Oct 2 '17 at 21:15










1 Answer
1






active

oldest

votes

















up vote
1
down vote













TCP networking is clearly working: you get a connection, and alternative connection tools such as nc also demonstrate this.



It is either MySQL blocking the incoming connection itself (likely) or your version has been compiled with TCP Wrappers and that is set to require Reverse DNS and maybe even forward/reverse matching.



The MySQL documentation B.5.2.5 Host 'host_name' is blocked explains that too many incomplete connections will cause the originating IP address to be blocked until mysqladm flush-hosts is run. Or you can login and execute FLUSH HOSTS.



To check the TCP Wrappers configuration you need to look at /etc.hosts.allow and /etc/hosts.deny.






share|improve this answer






















  • I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
    – Andreas Winkler
    Oct 3 '17 at 8:48











  • How do I check if compiled with TCP Wrappers?
    – Andreas Winkler
    Oct 3 '17 at 8:50










  • lsof -i :3306 shows *:mysql LISTEN on server.
    – Andreas Winkler
    Oct 3 '17 at 8:53










  • When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
    – Andreas Winkler
    Oct 3 '17 at 8:57










  • I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
    – Andreas Winkler
    Oct 3 '17 at 10:28










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395700%2fmysql-remote-connection-not-succeeding%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













TCP networking is clearly working: you get a connection, and alternative connection tools such as nc also demonstrate this.



It is either MySQL blocking the incoming connection itself (likely) or your version has been compiled with TCP Wrappers and that is set to require Reverse DNS and maybe even forward/reverse matching.



The MySQL documentation B.5.2.5 Host 'host_name' is blocked explains that too many incomplete connections will cause the originating IP address to be blocked until mysqladm flush-hosts is run. Or you can login and execute FLUSH HOSTS.



To check the TCP Wrappers configuration you need to look at /etc.hosts.allow and /etc/hosts.deny.






share|improve this answer






















  • I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
    – Andreas Winkler
    Oct 3 '17 at 8:48











  • How do I check if compiled with TCP Wrappers?
    – Andreas Winkler
    Oct 3 '17 at 8:50










  • lsof -i :3306 shows *:mysql LISTEN on server.
    – Andreas Winkler
    Oct 3 '17 at 8:53










  • When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
    – Andreas Winkler
    Oct 3 '17 at 8:57










  • I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
    – Andreas Winkler
    Oct 3 '17 at 10:28














up vote
1
down vote













TCP networking is clearly working: you get a connection, and alternative connection tools such as nc also demonstrate this.



It is either MySQL blocking the incoming connection itself (likely) or your version has been compiled with TCP Wrappers and that is set to require Reverse DNS and maybe even forward/reverse matching.



The MySQL documentation B.5.2.5 Host 'host_name' is blocked explains that too many incomplete connections will cause the originating IP address to be blocked until mysqladm flush-hosts is run. Or you can login and execute FLUSH HOSTS.



To check the TCP Wrappers configuration you need to look at /etc.hosts.allow and /etc/hosts.deny.






share|improve this answer






















  • I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
    – Andreas Winkler
    Oct 3 '17 at 8:48











  • How do I check if compiled with TCP Wrappers?
    – Andreas Winkler
    Oct 3 '17 at 8:50










  • lsof -i :3306 shows *:mysql LISTEN on server.
    – Andreas Winkler
    Oct 3 '17 at 8:53










  • When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
    – Andreas Winkler
    Oct 3 '17 at 8:57










  • I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
    – Andreas Winkler
    Oct 3 '17 at 10:28












up vote
1
down vote










up vote
1
down vote









TCP networking is clearly working: you get a connection, and alternative connection tools such as nc also demonstrate this.



It is either MySQL blocking the incoming connection itself (likely) or your version has been compiled with TCP Wrappers and that is set to require Reverse DNS and maybe even forward/reverse matching.



The MySQL documentation B.5.2.5 Host 'host_name' is blocked explains that too many incomplete connections will cause the originating IP address to be blocked until mysqladm flush-hosts is run. Or you can login and execute FLUSH HOSTS.



To check the TCP Wrappers configuration you need to look at /etc.hosts.allow and /etc/hosts.deny.






share|improve this answer














TCP networking is clearly working: you get a connection, and alternative connection tools such as nc also demonstrate this.



It is either MySQL blocking the incoming connection itself (likely) or your version has been compiled with TCP Wrappers and that is set to require Reverse DNS and maybe even forward/reverse matching.



The MySQL documentation B.5.2.5 Host 'host_name' is blocked explains that too many incomplete connections will cause the originating IP address to be blocked until mysqladm flush-hosts is run. Or you can login and execute FLUSH HOSTS.



To check the TCP Wrappers configuration you need to look at /etc.hosts.allow and /etc/hosts.deny.







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 3 '17 at 15:47









DopeGhoti

41k55080




41k55080










answered Oct 3 '17 at 7:46









roaima

40.1k547110




40.1k547110











  • I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
    – Andreas Winkler
    Oct 3 '17 at 8:48











  • How do I check if compiled with TCP Wrappers?
    – Andreas Winkler
    Oct 3 '17 at 8:50










  • lsof -i :3306 shows *:mysql LISTEN on server.
    – Andreas Winkler
    Oct 3 '17 at 8:53










  • When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
    – Andreas Winkler
    Oct 3 '17 at 8:57










  • I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
    – Andreas Winkler
    Oct 3 '17 at 10:28
















  • I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
    – Andreas Winkler
    Oct 3 '17 at 8:48











  • How do I check if compiled with TCP Wrappers?
    – Andreas Winkler
    Oct 3 '17 at 8:50










  • lsof -i :3306 shows *:mysql LISTEN on server.
    – Andreas Winkler
    Oct 3 '17 at 8:53










  • When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
    – Andreas Winkler
    Oct 3 '17 at 8:57










  • I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
    – Andreas Winkler
    Oct 3 '17 at 10:28















I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
– Andreas Winkler
Oct 3 '17 at 8:48





I ran mysqladmin flush-hosts with exit value 0 on host and then tried to connect. No change. Content of hosts.allow ALL:ALL Content of hosts.deny Empty
– Andreas Winkler
Oct 3 '17 at 8:48













How do I check if compiled with TCP Wrappers?
– Andreas Winkler
Oct 3 '17 at 8:50




How do I check if compiled with TCP Wrappers?
– Andreas Winkler
Oct 3 '17 at 8:50












lsof -i :3306 shows *:mysql LISTEN on server.
– Andreas Winkler
Oct 3 '17 at 8:53




lsof -i :3306 shows *:mysql LISTEN on server.
– Andreas Winkler
Oct 3 '17 at 8:53












When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
– Andreas Winkler
Oct 3 '17 at 8:57




When using tcpdump port 3306 and '(tcp-syn|tcp-ack)!=0' on server I get this when trying to connect to it: 10:55:44.195273 IP server2.xxx.xxx.mysql > xxx.xxx.12.89.53920: Flags [R], seq 1740903883, win 0, length 0
– Andreas Winkler
Oct 3 '17 at 8:57












I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
– Andreas Winkler
Oct 3 '17 at 10:28




I get this when trying to connect to db server: "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory"
– Andreas Winkler
Oct 3 '17 at 10:28

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395700%2fmysql-remote-connection-not-succeeding%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay