I knew boolean in mysql as tinyint (1).Today I see a table with defined an integer like tinyint(2), and also others like int(4), int(6) ... What does the size means in field of type integer and tinyint ? 解决方案 It means display widthWhether you use tinyint(1) or tinyint(2), it does not make any difference.I always use tinyint(1) and int(11), I used several mysql clients (navicat, sequel pro).It does not mean anything AT ALL! I ran a test, all above clients or even the command-line client seems to ignore this.But, display width is most important if you are using ZEROFILL option, for example your table has following 2 columns:A tinyint(2) zerofillB tinyint(4) zerofillboth columns has the value of 1, output for column A would be 01 and 0001 for B, as seen in screenshot below :) 这篇关于MySql:Tinyint(2)vs tinyint(1)-有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-12 08:24