mysql - Rails Passenger 和 mysql 拒绝用户访问

标签 mysql ruby-on-rails apache passenger

我有一个在 Fedora 20 上针对 Apache 和 mysql (Maria db) 运行的 Rails 应用程序 在最近更新 Fedora 之前它没有任何问题,之后 passanger 因此错误而失败

Web application could not be started

Access denied for user 'user'@'localhost' to database 'TheDB' (Mysql2::Error)

使用 WEBrick 从命令行运行 Rails 工作正常,也可以使用

连接到 mysql

mysql -u user -h loalhost m -p

重新安装乘客和 mysql2 gem 没有帮助

经过几个小时的解决这个问题后,我完全不知道还能尝试什么

我欢迎任何想法

最佳答案

如果您可以从命令行使用正确的用户名和密码进行连接,但您的脚本无法使用相同的凭据进行连接,请检查数据库 mysql、表 user 的主机列中的正确值。

SELECT Host FROM mysql.user WHERE User='myusername';

来自http://dev.mysql.com/doc/refman/5.1/en/connection-access.html :

Identity checking is performed using the three user table scope columns (Host, User, and Password). The server accepts the connection only if the Host and User columns in some user table row match the client host name and user name and the client supplies the password specified in that row.

检查是否 sorting rules不会影响您:

The server uses the first row that matches the client host name and user name.

关于mysql - Rails Passenger 和 mysql 拒绝用户访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21311569/

相关文章:

mysql - SQL 结果水平而不是垂直

mysql - 在 LEFT JOIN 语句中使用 CASE 结果 (MySQL)

MySQL只插入第一行

ruby-on-rails - 西类牙语中有一些官方的Activerecord错误翻译吗?

ruby-on-rails - 将 X-Frame-Options 添加到 Heroku Rails 2.3.15 应用程序

mysql - 连接查询和分组以显示结果

jquery - Ruby on Rails/AJAX : How can I refresh page on successful submit or display error?

linux - 如何创建 httpd.conf 文件

python - 在我的 apache 本地主机 Ubuntu 12.04 中安装 WSGI

php - netbeans 显示 "Waiting For Connection (netbeans-xdebug)"