题目与数据集:https://blog.csdn.net/original_recipe/article/details/91958663
踩坑:
mysql的字符集(直接粘去用):show variables where Variable_name like ‘%char%’;
查看某一个数据库字符集:show create database test;(注:test为数据库)
查看某一个数据表字符集:show create table Student;(注:Student为数据表)
修改mysql的字符集:
mysql> set character_set_client=utf8;
mysql> set character_set_connection=utf8;
mysql> set character_set_database=utf8;
mysql> set character_set_results=utf8;
mysql> set character_set_server=utf8;
mysql> set character_set_system=utf8;
mysql> set collation_connection=utf8;
修改数据库的字符集:
alter database test character set utf8;
修改数据表的字符集:
alter table Student character set utf8;
修改数据表字段的字符集:
alter table Student change Sname Sname varchar(10) character set utf8