Can't insert some special characters into mysql -
the value cut off after character đź’€
why happening?
create table tmp2(t1 varchar(100)); insert tmp2 values('befoređź’€after'); mysql> select * tmp2; +--------+ | t1 | +--------+ | before | +--------+ 1 row in set (0.01 sec)
i ran followed commands , returned useful information
mysql> show full columns tmp2; +-------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | field | type | collation | null | key | default | | privileges | comment | +-------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | t1 | varchar(100) | utf8_general_ci | yes | | null | | select,insert,update,references | | +-------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+ 1 row in set (0.00 sec)
and this,
mysql> select character_set_name information_schema.`columns` table_schema = "test" , table_name = "tmp2" , column_name = "t1"; +--------------------+ | character_set_name | +--------------------+ | utf8 | +--------------------+ 1 row in set (0.00 sec)
im testing on ubuntu/mysql command line.
i found solution here
i learnt characters not includes in utf8
there article here
i needed change column utf8 utf8mb4 , worked
alter table tmp2 modify t1 varchar(100) character set utf8mb4; set names utf8mb4; insert tmp2 values('befoređź’€after');
Comments
Post a Comment