[英]`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
When I tried to run rails s on remote server I got this issue. 当我尝试在远程服务器上运行rails时,出现了此问题。
Mysql working fine with "rails db" MySQL与“ rails db”正常工作
Find your socket file using 使用找到您的套接字文件
mysqladmin variables | grep socket
And then add the socket file to your database.yml configuration 然后将套接字文件添加到您的database.yml配置中
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
socket: <socket location>
MySQL登录/传递是否正常,并且mysql服务器正在运行?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.