数据库连接语句只能这么写
$sql_obj=new sql_tools(".","sss","ssss","ssss","utf8");
写成$sql_obj=new sql_tools("localhost","sss","ssss","ssss","utf8");就报错Can't create TCP/IP socket

解决方案 »

  1.   

    解决方法:    出现这个错误并不是php也不是mysql的bug,主要是由于系统的权限设置的功能,一个简单的方法就是开启mysql和php安装目录中everyone用户的读取权限,实在不行就先开启完全控制的权限,再进行权限关闭排查。
      

  2.   

    在服务器上,命令行是没有问题的
    D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -hlocalhost -uroot -p
    Enter password: ******
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 7000
    Server version: 5.0.83-community-nt MySQL Community Edition (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      

  3.   

    my.ini  中我开启了
    enable-named-pipe 这个开启之后只能 用"."
    如果不开启就访问不了
      

  4.   

    建议重新安装mysql
      

  5.   

    远程能用ip访问 无法用localhost访问。
    D:\wangzhan\phpStudy\MySQL\bin>mysql -hlocalhost -usss -p
    Enter password: ******
    ERROR 1045 (28000): Access denied for user 'sss'@'localhost' (using password:YES)
      

  6.   

    你远程怎么能用localhostlocalhost是访问本机的数据库服务器