【发布时间】:2014-02-26 12:05:42
【问题描述】:
我在 Justhost 服务器上有 Rails 3 应用程序。我仍在努力,但有时我会收到此错误:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
我检查了类似的问题: here
我试过这个命令mysqladmin variables | grep socket
得到这个错误
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'ecotec11'@'localhost' (using password: NO)'
不明白这怎么会发生。因为我很久没有修改database.yml文件了。
我检查了我的数据库状况良好,用户名和密码相同。
我尝试使用touch tmp/restart.txt 重新启动服务器,但这里没有运气!
【问题讨论】:
-
尝试在 database.yml 中将其注释掉
-
尝试使用 -user -password 参数运行 mysqladmin。
-
@Baloo 我注释掉了套接字行,项目又启动了。
-
@japed。谢谢!这对我有用。
标签: mysql ruby-on-rails sockets