当前位置:网站首页>sql编码bug
sql编码bug
2022-07-27 18:15:00 【Fairy要carry】
场景:
之前在写订单业务中,我远程了用户信息模块和课程信息模块,然后封装到订单类中进行插入,全程debug一遍发现数据都是正常的,没有编码问题,当调用insert插入到数据库中时候发现出现了bug,中文乱码,猜测是server到sql时候可能编码有问题
解决:
show databases;
对有问题的表设置下字符集
alter database xxx character set utf8;查看mysql字符集
show variables where Variable_name like '%char%';查看数据表字符集
show create table t_demo;修改数据库字符集
set character_set_client=utf8;
set character_set_connection=utf8;
set character_set_database=utf8;
set character_set_results=utf8;
set character_set_server=utf8;
set character_set_system=utf8;
set collation_connection=utf8;
set collation_database=utf8;
set collation_server=utf8;修改数据表字符集
alter table t_demo character set utf8;边栏推荐
- Users and permissions revoke user permissions
- 一个程序员的水平能差到什么程度?
- adb shell ls /system/bin(索引表)
- Apple Mobile Bluetooth networking
- Common ways to keep requests idempotent
- Some contents related to cmsis-rtos
- DP (dynamic programming)
- Nailing development document
- 【分层强化学习】HAC论文及代码
- 金仓数据库 KingbaseES异构数据库移植指南 (3. KingbaseES移植能力支撑体系)
猜你喜欢

leetcode:1498. 满足条件的子序列数目【排序 + 二分 + 幂次哈希表】

Mlx90640 infrared thermal imager temperature sensor module development notes (VII)

做测试, 就得去大厂,内部披露BAT大厂招聘“潜规则”

一文了解Pycharm快捷键

EasyCVR平台关闭录像为何还会有TS切片文件生成?

【毕设教程】YOLOv7 目标检测网络解读

UE5使用DLSS(超级采样)提升场景的 FPS 远离卡顿的优化方案

Analysis on the optimization of login request in IM development of instant messaging mobile terminal

金仓数据库 KingbaseES 异构数据库移植指南 (4. 应用迁移流程)

One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress
随机推荐
Some contents related to cmsis-rtos
How bad can a programmer be?
JVS基础框架功能列表
[rctf2015]easysql-1 | SQL injection
【防抖与节流】
openresty lua-resty-core 使用
access control
面了个腾讯拿38K跳槽出来的,见识到了真正的测试天花板
做测试, 就得去大厂,内部披露BAT大厂招聘“潜规则”
EasyCVR平台添加RTSP设备时,出现均以TCP方式连接的现象是什么原因?
DP (dynamic programming)
金仓数据库 Oracle至KingbaseES迁移最佳实践(2. 概述)
LabVIEW学习笔记五:按钮按下后无法返回原状
【程序人生】“阶段总结“-不甘平凡
Nailing development document
Ie11 method of downloading doc PDF and other files
LabVIEW学习笔记九:捕捉由程序修改控件值产生的“值改变”事件
vant组件库
MySQL log query log
Users and permissions restrict users from using resources