是不是你在建站点的时候设置了站点为http://127.0.0.1了呢?
解决方案 »
- for里一个“+”和“*”出现的问题!
- 关于Function 函数 如何返回值的问题
- 麻烦帮忙看下正则那里不对啊挖个图片地址
- 工作原因 .net(C#) 转入php 开头感觉好不顺
- 用php读取xml, 以下格式该如何解析并读取?
- 谁知道开发一个大型物流系统要多少钱
- 在文本数据库里我是用的table键做的空格,怎么才能explode分离字段?急救!谢谢!
- ->唠叨大哥请进:关于24小时内点击最高的新闻sql语句
- 请教"&"问题?
- smarty生成的静态页和thinkPHP生成的静态页的区别
- paypal支付接口??
- 最后的分了 。Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';是什么意思
#2002 - Can't connect to local MySQL server through socket '/usr/local/mysql/var/mysql.sock' (13)
检查mysql启动后/usr/local/mysql/var/mysql.sock是否存在。
A frequent error message received when using the mysql command line utility is: Can't connect to local MySQL server through socket '/tmp/mysql.sock' While this error message can be frustrating, the solution is simple.Directions
When connecting to a MySQL server located on the local system, the mysql client connects thorugh a local file called a socket instead of connecting to the localhost loopback address 127.0.0.1. For the mysql client, the default location of this socket file is /tmp/mysql.sock. However, for a variety of reasons, many MySQL installations place this socket file somewhere else like /var/lib/mysql/mysql.sock.While it is possible to make this work by specifying the socket file directly in the mysql client commandmysql --socket=/var/lib/mysql/mysql.sock ...
it is painful to type this in every time. If you must do so this way (because you don't have permissions to the file in the solution below), you could create an alias in your shell to make this work(like alias mysql="mysql --socket=/var/lib/mysql/mysql.sock" depending on your shell).To make your life easier, you can make a simple change to the MySQL configuration file /etc/my.cnf that will permanently set the socket file used by the mysql client. After making a backup copy of /etc/my.cnf, open it in your favorite editor. The file is divided into sections such as[mysqld]
datadir=/usr/local/mysql/data
socket=/var/lib/mysql/mysql.sock[mysql.server]
user=mysql
basedir=/usr/local/mysqlIf there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such as:[client]
socket=/var/lib/mysql/mysql.sockIf there is already a [client] section in the my.cnf file, add or edit the socket line as appropriate. You won't need to restart your server or any other processes. Subsequent uses of the mysql client will use the proper socket file.