vim /etc/my.cnf
[client]
default-character-set=utf8
grant all privileges on $(database).* to "$(user)"@"localhost"identified by "$(password)";
[client]
default-character-set=utf8
检查数据表所有字段的状态:
show full columns from $(table);
发现字段项非utf8,修改方法:
alter table $(table) change $(columns) $(columns) varchar(100) character set utf8 collate utf8_unicode_ci not null default '';
mysql授权命令
grant all privileges on $(database).* to "$(user)"@"%"identified by "$(password)";
grant all privileges on $(database).* to "$(user)"@"localhost"identified by "$(password)";