2016-04-13 13 views
1

パスワードは正常ですが、Railsは機能しません。Rails Mysql2 :: Errorユーザー 'root' @ 'localhost'のアクセスが拒否されました(パスワード:NOを使用)

アプリケーショントレース|フレームワークトレース|完全なトレース

mysql2 (0.4.3) lib/mysql2/client.rb:87:in `connect' 
mysql2 (0.4.3) lib/mysql2/client.rb:87:in `initialize' 
activerecord (4.2.6) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new' 
activerecord (4.2.6) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout' 
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection' 
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection' 
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection' 
activerecord (4.2.6) lib/active_record/connection_handling.rb:113:in `retrieve_connection' 
activerecord (4.2.6) lib/active_record/connection_handling.rb:87:in `connection' 
activerecord (4.2.6) lib/active_record/migration.rb:383:in `connection' 
activerecord (4.2.6) lib/active_record/migration.rb:370:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' 
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__' 
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks' 
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' 
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' 
web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call' 
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch' 
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app' 
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call' 
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged' 
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged' 
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' 
rack (1.6.4) lib/rack/runtime.rb:18:in `call' 
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
rack (1.6.4) lib/rack/lock.rb:17:in `call' 
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call' 
rack (1.6.4) lib/rack/sendfile.rb:113:in `call' 
railties (4.2.6) lib/rails/engine.rb:518:in `call' 
railties (4.2.6) lib/rails/application.rb:165:in `call' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception' 

答えて

0

rails dbconsoleは同じエラーを表示しますか?その場合は、database.ymlファイルを確認してください。二つの可能性があります。

  • ユーザー名は
  • パスワードが
+0

その作業PASSORD /ログインどのような作品 –

+1

間違っている間違っていますか?どのコマンドがエラーを出すのかを具体的に記述できますか? –

+0

/usr/local/lib/ruby/gems/2.3.0/gems/railties- –

0
/usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/configuration.rb:115:in `rescue in database_configuration': YAML syntax error occurred while parsing /usr/share/nginx/html/blog/myapp/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): did not find expected key while parsing a block mapping at line 12 column 1 (RuntimeError) 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/configuration.rb:98:in `database_configuration' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/dbconsole.rb:119:in `configurations' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/dbconsole.rb:99:in `config' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/dbconsole.rb:22:in `start' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/dbconsole.rb:11:in `start' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:86:in `dbconsole' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!' 
     from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 
+0

詳細情報を回答として投稿するのではなく、質問を編集してください。 –

関連する問題