“访问被拒绝"; Rails连接到Mysql时 [英] "Access Denied" when rails connects to Mysql
本文介绍了“访问被拒绝"; Rails连接到Mysql时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经完成了多个地方提到的所有步骤,而且我还从lynda.com视频教程中学到了东西.我使用Mac 10.7,并安装了rubystack.我创建了数据库,添加并检查了数据库.在这里,您可以再次看到它.
I have did all the procedures as mentioned in several places and I also learned from lynda.com video tutorial. I used Mac 10.7 and I installed rubystack. I created the databases, add and checked the database.yml here is you can see it again.
development:
adapter: mysql2
encoding: utf8
reconnect: false
host: localhost
database: simplecmsdevelopment
pool: 5
username: simple_cms
password: maiwandj
socket: /tmp/mysql.sock
因此,当我运行rake db:schema:dump时,它会显示以下错误
Therefore, when I run rake db:schema:dump it print the following errors
bash-3.2$ rake db:schema:dump
/Applications/rubystack-1.9.3-18/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/runtime.rb:220: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
rake aborted!
Access denied for user 'simplecms'@'localhost' (using password: YES)
/Applications/rubystack-1.9.3-18/simplecms/config/environment.rb:5:in `' Tasks: TOP => db:schema:dump => environment (See full trace by running task with --trace)
推荐答案
您是否已授予该用户对该数据库的权限?即GRANT ALL PRIVILEGES ON simplecmsdevelopment.* TO simple_cms@localhost;
Have you granted permissions for that user on that database? i.e., GRANT ALL PRIVILEGES ON simplecmsdevelopment.* TO simple_cms@localhost;
这篇关于“访问被拒绝"; Rails连接到Mysql时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文