<![CDATA[Snooda]]> http://www.ltylc2014.com/index zh-cn http://www.ltylc2014.com/read/340 <![CDATA[mysql的varchar和char长度的含义(中文长度Q]]> snooda <admin@snooda.com> Mon, 07 Dec 2015 11:22:14 +0000 http://www.ltylc2014.com/read/340

    可以通过mysql官方文档来看Q?br/>    http://dev.mysql.com/doc/refman/5.0/en/char.html

The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example, CHAR(30) can hold up to 30 characters.


If strict SQL mode is not enabled and you assign a value to a CHAR or VARCHAR column that exceeds the column's maximum length, the value is truncated to fit and a warning is generated.

     文档中提到。默认情况下会截断而不q回错误。如果需要返回错误,需要开启strict mode

Tags - , ]]>