I have a PHP script that is executed by cron on one of our Linux servers. As part of its task, the script will run some queries from local MySQL database. But lately I've been seeing this error message (which is emailed to me) from the script:
Warning: mysql_connect(): Lost connection to MySQL server at 'sending authentication information', system error: 32 in /php/my-php-script.php
It's baffling because I don't get the error message all the time, just occasionally. When I execute the script from the Linux command line, it runs, no problem, no error message.
The odd thing was that I started to get this problem after I had ran upgraded the MySQL passwords on all my servers from the old 16 byte to 41 bytes, and yet only this one particular server was giving me this oddball Mysql system error 32 message. It turned out that I had forgotten to upgrade this one, and in the /etc/my.cnf file I had already commented out:
The way you can tell if you still have the old 16 byte passwords is with this query:
SELECT user, LENGTH(password) FROM mysql.user;
If the LENGTH(password) is 16, then you have the old pre-MySQL 4.1 passwords.
After I upgraded the passwords on the mysql user tables for this server I did not have any more of these strange MySQL system error 32 problems any longer. Hope this helps someone out there with a similar problem!