`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error) [英] `connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
本文介绍了`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试在远程服务器上运行 rails 时,我遇到了这个问题.
When I tried to run rails s on remote server I got this issue.
Mysql 与rails db"配合良好
Mysql working fine with "rails db"
推荐答案
使用
mysqladmin variables | grep socket
然后将套接字文件添加到您的 database.yml 配置中
And then add the socket file to your database.yml configuration
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
socket: <socket location>
这篇关于`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文