在产品服务器上,连接到mySql通常会失败

On product server, connecting to mySql often fails, "Can't connect to MySQL server on xxx" but the site works well, just sometimes "mysql server has gone away". I tried mysql_connect even mysql_pconnect.

Hard to answer to this question because there can be really a lot of reasons for the error, the best description of the problem can be found in MySQL documentation.

You should be able to further investigate the issue by going through MySQL logs or we might be able to help you if you actually posted problematic MySQL logs here.