关于mysql中的int(m)

来源:互联网 发布:centos6.5 yum源配置 编辑:程序博客网 时间:2024/04/28 03:16

<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:595.3pt 841.9pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:42.55pt;mso-footer-margin:49.6pt;mso-paper-source:0;layout-grid:15.6pt;}div.Section1{page:Section1;}-->

关于mysql中的intm):

mysql 数字类型的 int(3)int(1) 其中括号数字表示什么.

官方有一段话:

 

Anotherextension is supported by MySQL for optionally specifying the display width ofinteger data types in parentheses following the base keyword for the type (forexample, INT(4)). This optional display width is used to display integer valueshaving a width less than the width specified for the column by left-paddingthem with spaces.

所以说m可不是表示存贮大小的,他表示的当数据的宽度,要是数据的宽度小于m,就用空格左补充。mysqlint型是长整形,也就是0~232,也就是4个字节啦。