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

你可能感兴趣的:(socket,ror)