我的页面运行良好,我发誓我没有更改任何内容。现在它返回这个:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/93/10501493/html/go/connect.php on line 15
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/connect.php on line 16
Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/login.php on line 16
Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/login.php on line 17
Warning: mysql_close() expects parameter 1 to be resource, boolean given in /home/content/93/10501493/html/go/connect.php on line 18
有什么明显的东西跳出来吗?
最佳答案
确保mysql服务正在运行
service mysqld start
或者
您正在连接到“localhost”还是“127.0.0.1”?当您连接到“localhost”时,将使用套接字连接器,但是当您连接到“127.0.0.1”时,将使用 TCP/IP 连接器。你可以 如果套接字连接器未启用/工作,请尝试使用“127.0.0.1”。
关于php - 返回警告错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26291613/