You have to be sure that mysql user can read/write to mysqlsock You can also try to change the path of the socket by using my.cnf file in /etc/ (if you don't have one you have to create it, there is some model in your mysql install dir) 
socket=/var/lib/mysql/mysql.sock 
For example 
You have to be sure that mysql user can read/write this file

解决方案 »

  1.   

    run the doemon first:)
    #/etc/rc.d/init.d/mysql start
      

  2.   

    I know a little Entlish,
    But I have got your think by that
    And when i login  by root I have got that ERROR,
    so I think I have all pre to do everything in linux
    if you can speek chinese please in chinease, thanks
      

  3.   

    把系统目录下的MY.INI删除后重装一下MYSQL试试
      

  4.   

    这种问题出现在多种情况,直接看通常是socket连接失败,就是说mysql client连接到服务器的时候建立一个socket失败.
    1.比如你没有启动mysql服务器,解决方法: #/etc/rc.d/init.d/mysql start  (redhat)
    2.看看/etc/my.cnf文件中socket=选项中中路径有没有权限读写.chmod
    3.是不是network没有启动,如在init 1模式下..
    .....最好把你的配置信息和服务器运行状态连错误都帖出来.:)
      

  5.   

    问题找到了,我的mysql是系统自带的,可能是不全,根本就找不到'/var/lib/mysql/mysql.sock'文件,我是菜鸟,如何得到我的配置信息和服务器运行状态
    请楼上的大哥指教!
    还有我想重装mysql,如何卸载原来的mysql?