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

时间:2022-08-30 15:53:06

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

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.