我希望这个问题不是多余的。我看到了一个几乎像它的问题,但由于问题有点不同,所以没有任何帮助。
我正在尝试将我的ruby rails应用程序连接到我的MySQL数据库时使用sudo rake db:migrate
但是(和其他一些命令)我得到以下输出
错误说我设置了密码,但据我所知,我没有。我采取了我能想到的每一项措施,以确保没有任何措施。
rake aborted!
Mysql::Error: Access denied for user 'root'@'localhost' (using password: YES)
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:456:in `real_connect'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:456:in `connect'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:108:in `initialize'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:36:in `new'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:36:in `mysql_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:567:in `retrieve_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/connection_handling.rb:87:in `connection'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/migration.rb:913:in `initialize'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/migration.rb:820:in `new'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-4.2.2/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我还是比较新,所以如果有任何相关信息我没有提供,请告诉我。
任何帮助都会有很大的不同。
答案 0 :(得分:0)
(使用密码:YES)部分错误错误表示您发送了密码进行身份验证,而不是设置了密码。如果数据库上没有一组,请从database.yml中删除password: whatever
行。