搜索

10分钟学会理解和解决MySQL乱码问题

发表于 2025-11-04 14:33:36 来源:全栈开发
10分钟学会理解和解决MySQL乱码问题
复制master [localhost] {msandbox} (test) > createtable charset_test_utf8 (id intprimarykey auto_increment,分钟 char_col varchar(50)) charset = utf8;  Query OK, 0 rows affected (0.04 sec)  master [localhost] {msandbox} (test) > set names gbk;  Query OK, 0 rows affected (0.00 sec)  master [localhost] {msandbox} (test) > insertinto charset_test_utf8 (char_col) values (中文);  Query OK, 1 row affected, 1 warning (0.01 sec)  master [localhost] {msandbox} (test) > show warnings;  +---------+------+---------------------------------------------------------------------------+ | Level | Code | Message |  +---------+------+---------------------------------------------------------------------------+ | Warning | 1366 | Incorrect string value: \xAD\xE6\x96\x87forcolumnchar_colat row 1 |  +---------+------+---------------------------------------------------------------------------+ 1 row inset (0.00 sec)  master [localhost] {msandbox} (test) > select id,hex(char_col),char_col from charset_test_utf8;  +----+----------------+----------+ | id | hex(char_col) | char_col |  +----+----------------+----------+ | 1 | E6B6933FE69E83 | ? |  +----+----------------+----------+ 1 row inset (0.01 sec)  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.
随机为您推荐
版权声明:本站资源均来自互联网,如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

Copyright © 2016 Powered by 10分钟学会理解和解决MySQL乱码问题,全栈开发  滇ICP备2023006006号-32sitemap

回顶部