“ERROR 1406: 1406: Data too long for column” but it shouldn't be?

后端 未结 3 1843
暖寄归人
暖寄归人 2021-02-05 23:54

I have the following table structure:

DROP TABLE IF EXISTS `tblusers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_         


        
3条回答
  •  遥遥无期
    2021-02-06 00:22

    isadmin is a column of type bit and you are storing a value of type varchar in it which is of larger size than bit. modify query as follows:-

    UPDATE `tblusers` SET `IsAdmin`=b'1'  WHERE `UserID`='79';
    

提交回复
热议问题