What is the difference between BIT and TINYINT in MySQL?

前端 未结 6 963
耶瑟儿~
耶瑟儿~ 2020-11-29 00:10

In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans?

6条回答
  •  庸人自扰
    2020-11-29 00:50

    From my experience I'm telling you that BIT has problems on linux OS types(Ubuntu for ex). I developped my db on windows and after I deployed everything on linux, I had problems with queries that inserted or selected from tables that had BIT DATA TYPE.

    Bit is not safe for now. I changed to tinyint(1) and worked perfectly. I mean that you only need a value to diferentiate if it's 1 or 0 and tinyint(1) it's ok for that

提交回复
热议问题