Home >Database >Mysql Tutorial >BLOB/TEXT column 'description' can't have a default value_MySQL

BLOB/TEXT column 'description' can't have a default value_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:44:011786browse

bitsCN.com MYSQL5.x在windows下是默认以‘strict mode’工作的,当建表语句中有类似:
description TEXT DEFAULT 'www.naozao.com'语句时,会给你一个错误或者警告信息
BLOB/TEXT column 'description' can't have a default value query
 
解决方法:
第一种. 去掉DEFAULT 'www.naozao.com'
第二种. 找到mysql安装根目录下的my.ini文件并注释掉sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 重启mysql
bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn