mysql报错:SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column ‘rule’ can’t have a default value


多次遇到这个问题了,今天特意记录一下:

SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'city' can't have a default value 

解决办法:

windows在my.ini文件 linux 在my.cnf文件

中找到sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"这行,在这句前面加个“#”注释掉这行重启MYSQL就好了,如下:

# Set the SQL mode to strict
#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM