I'm trying to connect to an external database with php and I'm getting the "Packets out of order." error. I searched for it and I already changed the "max_allowed_packet" by query and by my.cnf, and both of which did not solve the problem.
Warning: Packets out of order. Expected 0 received 45. Packet size=4739923 in
Warning: mysqli_connect(): MySQL server has gone away in Warning: mysqli_connect(): Error while reading greeting packet. PID=12844 in
Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in Unable to connect to database! Please try again later.