修改mysql数据库编码格式

登陆mysql数据库:

mysql -hlocalhost -uroot -p;

查看数据库编码格式:

use xx
show variables like 'character%';

+————————–+———————————————————–+
| Variable_name | Value |
+————————–+———————————————————–+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql-5.7.17-macos10.12-x86_64/share/charsets/ |
+————————–+———————————————————–+

修改数据库编码

alter database xx character set utf8;

你可能感兴趣的:(Python库)