mysql不能插入中文数据

    xiaoxiao2021-03-25  152

    上次遇到的是向mysql插入中文数据,中文数据乱码了。这次直接就不能插入中文数据了!!!!

    参考博文:http://blog.csdn.net/generalyy0/article/details/7598027

    总结:

    ①: 检查数据表所有字段的状态 show full columns from 表名;

    ②:发现Collation项非utf8,修改它! 【两处的字段名要相同的】 alter table 表名 change 字段名 字段名 varchar(100) character set utf8 collate utf8_unicode_ci not null default '';

    例子:

    alter table a_employee change password password varchar(255) character set utf8 collate utf8_unicode_ci not null default '';
    转载请注明原文地址: https://ju.6miu.com/read-4065.html

    最新回复(0)