PHP Warning: Packets out of order. Expected 1 received 2 Packet size=83

4,077 views
Skip to first unread message

Rishi Mittal

unread,
Nov 7, 2016, 4:33:35 AM11/7/16
to proxysql

Every time connection is made PHP throws the Warning

mysqli::real_connect($this->host, $this->user, $this->pass, $this->db)

PHP Warning: Packets out of order. Expected 1 received 2. Packet size=83
PHP Warning: mysqli::real_connect(): MySQL server has gone away in...

Rishi Mittal

unread,
Nov 7, 2016, 4:33:58 AM11/7/16
to proxysql
Any ideas??

I am Weasel

unread,
Nov 7, 2016, 7:05:59 AM11/7/16
to proxysql
Hi,

I noticed this behaviour when using persistent connection from php. We have to disable it.

Persistent connection was initiated by "p:" prefix for hostname

i.e.
$link mysqli_connect('p:localhost''fake_user''my_password''my_db');

I did not investigated other solutions, maybe its time to explain and document this case?

Regards
Rafał

René Cannaò

unread,
Nov 7, 2016, 7:44:56 AM11/7/16
to proxysql
I will be very happy to investigate and solve it. A tcpdump or an easy reproducible test case is much appreciated.

Thanks,
René

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rishi Mittal

unread,
Nov 7, 2016, 10:16:15 AM11/7/16
to proxysql
Yes, I was exactly the same issue, one I removed p: , it worked fine. also p: ( prefix) is deprecated in php5.5 onwards.


On Monday, November 7, 2016 at 3:03:35 PM UTC+5:30, Rishi Mittal wrote:

I am Weasel

unread,
Nov 7, 2016, 10:55:01 AM11/7/16
to proxysql
I'll try provide some dump, strange is I can see "access denied" couple of times in dump but not in proxysql.log. I have to compare fixed versus broken version (php app).

Regards
Rafał
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.

René Cannaò

unread,
Nov 8, 2016, 1:23:25 PM11/8/16
to proxysql
Replying here for a wider audience.

Thanks Rafał for the tcpdump file, was really useful to understand what is going on.

Apparently, PHP seems to use a veeeeeery old authentication method, described here:
http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse320

ProxySQL doesn't support this authentication method that, although still valid in MySQL, was outdated in MySQL 4.1 with the introduction of a new authentication:
http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse41

From the dump it also seems that:
- the client tries to authenticate using on old method
- proxysql doesn't recognize it, and replies access denied
- the client finally try to use the "new" (4.1+) method

I will reopen the issue, change title, but I think that the support for authentication pre-4.1 has veeeeeery low priority.

Thanks,
René

To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages