zoukankan      html  css  js  c++  java
  • 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 liblibmysql.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:ProgramDataMySQLMySQL 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服务

  • 相关阅读:
    redis存储session配制方法
    thanks使用注意事项;
    mongodb sort limit和skip用法
    mongoose的用法(注:连接数据库)
    mongoose查询特定时间段文档的方法
    webworker的使用案例
    js 传参数
    redis.config翻译
    Oracle keep详解
    自学之笔记总结
  • 原文地址:https://www.cnblogs.com/juandx/p/3871483.html
Copyright © 2011-2022 走看看