简体   繁体   English

Rails没有连接到MySQL

[英]Rails Not Connecting to MySQL

I'm trying to get my database to connect and interact properly with my SQL Database. 我正在尝试使我的数据库连接到SQL数据库并与之正确交互。 When I type... 当我键入...

rake db:schema:dump 耙db:schema:dump

I get........ 我明白了........

simple_cms gregpfeffer$ rake db:schema:dump
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_get_client_info
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

Trace/BPT trap: 5

I edited my database.yml to now read... 我编辑了database.yml,现在可以阅读...

#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: simple_cms_development
  pool: 5
  username: simple_cms      
  password: XXXXXXXXXX
  socket: /tmp/mysql.sock

Any idea whats going on here? 知道这里发生了什么吗? I have both the mySQL and mySQL2 gem installed, not sure if that helps. 我同时安装了mySQL和mySQL2 gem,不确定是否有帮助。

Thanks so much! 非常感谢! Greg Pfeffer 格雷格·菲弗

Try using mysql2 as adapter. 尝试使用mysql2作为适配器。 It seems you are using the mysql2 gem. 看来您正在使用mysql2 gem。

  adapter: mysql2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM