专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Ruby/Rails

ruby 连接 mysql 的有关问题

发布时间:2011-06-29 18:44:28 文章来源:www.iduyao.cn 采编人员:星星草
ruby 连接 mysql 的问题
想用ruby 连接 mysql 
修改database.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
  adapter: mysql
  encoding: utf8
  pool: 5
  database: test
  username: root
  password:  

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  encoding: utf8
  pool: 5
  database: test
  username: root
  password:  
production:
  adapter: mysql
  encoding: utf8
  pool: 5
  database: test
  username: root
  password: 


还是连接不上
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `retrieve_connection'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
activerecord (3.1.3) lib/active_record/query_cache.rb:67:in `rescue in call'
activerecord (3.1.3) lib/active_record/query_cache.rb:61:in `call'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.3) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.5) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.3) lib/rails/engine.rb:456:in `call'
rack (1.3.5) lib/rack/content_length.rb:14:in `call'
railties (3.1.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
D:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
D:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
D:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'


跪求高手~在线等答案~。。

------解决方案--------------------
本地环境mysql没有密码?password
------解决方案--------------------
解决了没?
或者加上 host: localhost 看看
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: