我目前正在尝试在rails上完成关于ruby的教程,当我输入“subject = Subject.new”
时,我在IRB中遇到了这个错误Mysql2::Error: Access denied for user 'simple_cms'@'localhost' (using password: YES)
当我运行
时,有没有办法将其提供给irbrails console
解决此问题的最佳方法是什么?
database.yml如下:
default: &default
adapter: mysql2
encoding: utf8
reconnect: false
host: localhost
pool: 5
username: simple_cms
password: mypasshere
socket: /tmp/mysql.sock
development:
<<: *default
database: simple_cms_development
<<: *default
database: simple_cms_test
production:
<<: *default
database: simple_cms_production
username: simple_cms
password: <%= ENV['SIMPLE_CMS_DATABASE_PASSWORD'] %>
非常感谢任何帮助!