不要急,mysql文档里有你的问题。
可惜英文的,楼主还是自己看看吧。
下面是其中的一部分:
If you encounter problems when you try to connect to the MySQL server, the following items describe some courses of action you can take to correct the problem. Make sure that the server is running. If it is not running, you cannot connect to it. For example, if you attempt to connect to the server and see a message such as one of those following, one cause might be that the server is not running:
shell> mysql
ERROR 2003: Can't connect to MySQL server on 'host_name' (111)
shell> mysql
ERROR 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111) It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To correct this when you invoke a client program, specify a --port option to indicate the proper port, or a --socket option to indicate the proper named pipe or Unix socket file. To find out what port is used, and where the socket is, you can do:
shell> netstat -l | grep mysql
可惜英文的,楼主还是自己看看吧。
下面是其中的一部分:
If you encounter problems when you try to connect to the MySQL server, the following items describe some courses of action you can take to correct the problem. Make sure that the server is running. If it is not running, you cannot connect to it. For example, if you attempt to connect to the server and see a message such as one of those following, one cause might be that the server is not running:
shell> mysql
ERROR 2003: Can't connect to MySQL server on 'host_name' (111)
shell> mysql
ERROR 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111) It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To correct this when you invoke a client program, specify a --port option to indicate the proper port, or a --socket option to indicate the proper named pipe or Unix socket file. To find out what port is used, and where the socket is, you can do:
shell> netstat -l | grep mysql
......../mysql-standard-4.1.8-pc-linux-i686/docs/manual.html#Can_not_connect_to_server
打开控制面板--》管理工具--》服务 找找mysql的服务情况
如果没启动,就把它启动吧