警告:mysql_pconnect():MySQL服务器已不再使用云数据库 [英] Warning: mysql_pconnect(): MySQL server has gone away with using cloud database
问题描述
警告:mysql_pconnect():第16行的D:\ xampp-portable \ htdocs \ project \ database \ dbconn.php中,MySQL服务器已消失
我在页面顶部收到此错误,但页面显示正确.我该如何解决此问题,或者只是避免在页面上显示警告?我正在使用从Windows Azure试用版创建的Cleardb.
I got this error on the top of the page, but the page shows correctly. How can i solve this problem or just avoid showing the warning on the page? I am using Cleardb created from Windows Azure trial.
第16行:$ conn = mysql_pconnect($ hostname_conn,$ username_conn,$ password_conn,TRUE)或trigger_error(mysql_error(),E_USER_ERROR);
推荐答案
只要您恢复自超时以来的持久连接,就会收到此错误.
You'll get this error any time you get back a persistent connection that has since timed out.
使用mysql_pconnect
而不是mysql_connect
是否有特定的原因?如果不是,请尝试使用mysql_connect
.
Is there a specific reason why you are using mysql_pconnect
instead of mysql_connect
? If not, try using mysql_connect
instead.
如果这是新代码,则根本不应该使用mysql_*
函数,因为它们本质上是不安全的,并且很快就会被弃用. 请尽可能使用PDO .
If this is new code, you shouldn't be using the mysql_*
functions at all as they are inherently unsafe and will soon be deprecated. Use PDO instead if possible.
这篇关于警告:mysql_pconnect():MySQL服务器已不再使用云数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!