我正在
Lost connection to MySQL server at 'reading initial communication packet', system error: 2
当我要连接我的数据库时错误。
如果我使用localhost,一切正常。但是当我使用下面的实时IP地址时,我收到错误:
mysql_connect("202.131.xxx.106:xxxx", "xxxx", "xxxxx") or die(mysql_error());
请帮帮我。感谢。
答案 0 :(得分:0)
为什么不使用localhost?
尝试没有端口号。
或
请检查您的服务器配置以及您正在使用的端口。
答案 1 :(得分:0)
您可以尝试以下方法:
localhost
my_user@localhost
和my_user@%
以及对象访问权限