mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-25 04:17:17 +00:00
docs: 批量博文
This commit is contained in:
19
Chapter3 - Server/3.5.md
Normal file
19
Chapter3 - Server/3.5.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# PHP、Mysql 乱码
|
||||
|
||||
|
||||
- 查看 Mysql 数据表字符编码
|
||||
- 查看表字段编码
|
||||
- 查看 PDO 连接编码
|
||||
- 查看 Mysql 数据库服务器编码
|
||||
|
||||
这次吃亏就是在 Mysql 数据库服务器编码导致。
|
||||
|
||||
- 查看数据库服务器编码
|
||||
```SQL
|
||||
show variables like 'character%';
|
||||
```
|
||||
|
||||
所以知道其他编码都正常,问题定位到数据库服务器编码问题。
|
||||
- vim /etc/my.cnf
|
||||
- character-set-server=utf8
|
||||
- 重启服务器
|
||||
Reference in New Issue
Block a user