rails下mysql出错问题mysql_api,blog/text

问题一:提示出错:cannot load such file -- mysql/mysql_api (LoadError)

此时我们回来看gem install mysql 时提示

  At the time of building this gem, the necessary DLL files where available
  in the following URL:

  http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0
.2-win32.zip/from/pick

  You can put the lib\libmysql.dll available in this package to your Ruby bin di
rectory.

原来没有动态链接库文件
只需按照给的网址下载 解压出来libmysql.dll将它放到ruby/bin 下即可
若是windows系统也可以放到system32目录下

 

 

 

问题二:

mysql 报错 ERROR 1101 (42000): BLOB/TEXT column can’t have a default value

rake db:migrate时候

 

先找到my.ini位置 C:\ProgramData\MySQL\MySQL Server 5.5

 

mysql 在创建 ci_sessions 表的时候报错:ERROR 1101 (42000): BLOB/TEXT column can’t have a default value

text或blob字段不允许有缺省值,这是由于strict mode导致的,只要在my.ini中去掉

sql-mode=”STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION”

就行了。主要是在windows下会是缺省strict mode。

然后重启mysql服务

 

posted @ 2014-07-27 15:52  juandx  阅读(444)  评论(0编辑  收藏  举报