mysql 命令行 select 中文乱码

创建日期: 2024-08-15 11:21 | 作者: 风波 | 浏览次数: 22 | 分类: MySQL

来源:https://blog.csdn.net/weixin_42194215/article/details/111265687

1. 查看系统支持的编码

show variables like 'character%';

2. 查询时设置 session 的编码

set names utf8; select * from logs;

set names utf8等价于: - SET character_set_client = utf8; //表示SQL离开客户端时的编码 - SET character_set_results = utf8; //服务器返回的结果集编码 - SET character_set_connection = utf8; //服务器接收后转换的字符编码

22 浏览
15 爬虫
0 评论