欢迎光临Software MyZone,有问题可留言或到站点论坛发帖,争取第一时间帮忙解决 || 站点论坛:火龙论坛 || 淘宝小店:应小心的易淘屋 【欢迎大家提建设性意见】

rails Can’t connect to local MySQL server through socket ‘/mysql.sock

解决方法一:指定socket
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
socket: /tmp/mysql.sock
解决方法二:给当前的应用程序创建软连接
ln -s /var/data/mysql/mysql.sock /usr/local/mysql/mysql.sock
详情:http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/
解决方法三:http://www.blogjava.net/asenyifei/articles/82575.html

发表评论