Score:0

My PHP sites do not work with mysql router

nl flag

I recently set up a mysql innodb cluster, and have configured mysqlrouter to sit in front of it.

On my PHP applications, if I change the port from 3306 to 6446, the application hangs when it tries to connect to the DB. I never see any error messages. I do have one PHP application that is working on port 6446: phpmyadmin.

The mysql commandline client works connecting to 6446.

I did find a bug that somebody filed on mysql saying that mysqlrouter doesn't support compression. If I try a connection with compression, it fails.

elyograg@gandalf:~$ mysql -h db -P 6446 --ssl-mode=required --compression-algorithms=zlib,zstd
ERROR 2066 (HY000): Connection failed due to wrongly configured compression algorithm

Because the mysql client immediately errors when trying compression, seems like if compression were the problem, web pages would immediately abort with an error, not hang.

If I try a short PHP code snippet to connect using either PDO or mysqli, it hangs indefinitely connecting to 6446 and works connecting to 3306.

Because phpmyadmin (which uses mysqli) works, I think phpmyadmin must be setting some non-default mysqli option that allows it to work connecting to 6446. I have tried finding the place in phpmyadmin where it creates the connection, but I am not very familiar with PHP code, so I haven't been able to find it.

What else can I do to troubleshoot this?

nl flag
Now even phpmyadmin isn't working. Best guess, there was some caching where a connection to 3306 was still active and usable. I am restarting phpmyadmin, apache2, and haproxy after each change.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.