方法/步骤
如果没有配置好cmd里面的mysql 环境变量,那就在系统高级设置那儿进行MySQL的环境变量设置。
win+R,调出“运行”,输入cmd,回车
登录数据库,
查看数据库
查看数据库字符编码
通过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;
mysql> set collation_database=utf8;
mysql> set collation_server=utf8;
当然还有:
修改数据库的字符集mysql>use mydb
mysql>alter database mydb character set utf8;
创建数据库指定数据库的字符集
mysql>create database mydb character set utf8;