Rails Mysql ActiveRecord::ConnectionNotEstablished -


i created new rails application, when started server tried connect gave server

error

activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection' activerecord (4.0.0) lib/active_record/connection_handling.rb:79:in `retrieve_connection' activerecord (4.0.0) lib/active_record/connection_handling.rb:53:in `connection' activerecord (4.0.0) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings' activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call' activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call' activerecord (4.0.0) lib/active_record/migration.rb:369:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__713349442__call__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app' railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged' railties (4.0.0) lib/rails/rack/logger.rb:21:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.5.5) lib/rack/methodoverride.rb:21:in `call' rack (1.5.5) lib/rack/runtime.rb:17:in `call' activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call' rack (1.5.5) lib/rack/lock.rb:17:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call' railties (4.0.0) lib/rails/engine.rb:511:in `call' railties (4.0.0) lib/rails/application.rb:97:in `call' rack (1.5.5) lib/rack/lock.rb:17:in `call' rack (1.5.5) lib/rack/content_length.rb:14:in `call' rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service' c:/ruby23/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service' c:/ruby23/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run' c:/ruby23/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread' 

database.yml

development:   adapter: mysql2   encoding: utf8   database: simple_cms_development   pool: 5   username: root   password: root   host: 127.0.0.1 

mysql running , password correct. tried connecting command line

g:\simple_cms>mysql -uroot -proot simple_cms_development warning: using password on command line interface can insecure. welcome mysql monitor.  commands end ; or \g. mysql connection id 7 server version: 5.6.21 mysql community server (gpl)  copyright (c) 2000, 2014, oracle and/or affiliates. rights reserved.  oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners.  type 'help;' or '\h' help. type '\c' clear current input statement.  mysql> 

can tell me might possible cause error

have @ /etc/mysql/my.cnf , check binding address of mysql deamon. doesnt bind ip. use unix sockets way faster ip connections,...

option name bind address bind-address if theres no match wont bind address. have socket specifies path unix socket. can use socket in database.yml

development:   adapter: mysql2   encoding: utf8   database: simple_cms_development   username: root   password: root   host: 127.0.0.1   pool: 5   socket: /path/to/the/socket/mysql.sock 

that should you,


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -