<legend id='N3LaQ'><style id='N3LaQ'><dir id='N3LaQ'><q id='N3LaQ'></q></dir></style></legend>

<small id='N3LaQ'></small><noframes id='N3LaQ'>

    • <bdo id='N3LaQ'></bdo><ul id='N3LaQ'></ul>

    1. <i id='N3LaQ'><tr id='N3LaQ'><dt id='N3LaQ'><q id='N3LaQ'><span id='N3LaQ'><b id='N3LaQ'><form id='N3LaQ'><ins id='N3LaQ'></ins><ul id='N3LaQ'></ul><sub id='N3LaQ'></sub></form><legend id='N3LaQ'></legend><bdo id='N3LaQ'><pre id='N3LaQ'><center id='N3LaQ'></center></pre></bdo></b><th id='N3LaQ'></th></span></q></dt></tr></i><div id='N3LaQ'><tfoot id='N3LaQ'></tfoot><dl id='N3LaQ'><fieldset id='N3LaQ'></fieldset></dl></div>

    2. <tfoot id='N3LaQ'></tfoot>

        django 字符集与 MySQL 的怪异

        时间:2023-10-08

          <legend id='QhI0x'><style id='QhI0x'><dir id='QhI0x'><q id='QhI0x'></q></dir></style></legend>

          <tfoot id='QhI0x'></tfoot>
                <tbody id='QhI0x'></tbody>
                <bdo id='QhI0x'></bdo><ul id='QhI0x'></ul>

                  <i id='QhI0x'><tr id='QhI0x'><dt id='QhI0x'><q id='QhI0x'><span id='QhI0x'><b id='QhI0x'><form id='QhI0x'><ins id='QhI0x'></ins><ul id='QhI0x'></ul><sub id='QhI0x'></sub></form><legend id='QhI0x'></legend><bdo id='QhI0x'><pre id='QhI0x'><center id='QhI0x'></center></pre></bdo></b><th id='QhI0x'></th></span></q></dt></tr></i><div id='QhI0x'><tfoot id='QhI0x'></tfoot><dl id='QhI0x'><fieldset id='QhI0x'></fieldset></dl></div>

                  <small id='QhI0x'></small><noframes id='QhI0x'>

                1. 本文介绍了django 字符集与 MySQL 的怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我看到了

                  OperationalError (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='")
                  

                  看起来我的一些变量是 UTF8 字符串

                  It looks like some of my variables are UTF8 strings

                  'name': 'pxc7x9dxcax87xc9x9fxc4xb1xc9xa5s 徽章'

                  'name': 'pxc7x9dxcax87xc9x9fxc4xb1xc9xa5s Badge'

                  这是配置问题吗?如果是这样,我该如何解决?我想处理 Unicode 中的所有内容(我认为).

                  Is this a configuration issue? If so, how can i solve it? I'd like to handle everything in Unicode (I think).

                  推荐答案

                  看来您的数据库默认为 latin1_swedish_ci,因此不能接受所有 utf8 字符.您需要更改 MySQL 数据库表的配置以使用 utf8_general_ci.可以在 MySQL 性能博客

                  It appears your database is defaulted to latin1_swedish_ci, and therefore cannot accept all utf8 characters. You need to change the configuration of the MySQL database tables to use utf8_general_ci. A good blogpost about this (with links to a tool) can be found at MySQL Performance Blog

                  这篇关于django 字符集与 MySQL 的怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我如何创建一个带有外键的 Django 模型,它不会将删除级联到它的孩子? 下一篇:Django“无法打开数据库文件"

                  相关文章

                2. <legend id='CeZI7'><style id='CeZI7'><dir id='CeZI7'><q id='CeZI7'></q></dir></style></legend>
                      <bdo id='CeZI7'></bdo><ul id='CeZI7'></ul>

                      <small id='CeZI7'></small><noframes id='CeZI7'>

                      <tfoot id='CeZI7'></tfoot>

                      <i id='CeZI7'><tr id='CeZI7'><dt id='CeZI7'><q id='CeZI7'><span id='CeZI7'><b id='CeZI7'><form id='CeZI7'><ins id='CeZI7'></ins><ul id='CeZI7'></ul><sub id='CeZI7'></sub></form><legend id='CeZI7'></legend><bdo id='CeZI7'><pre id='CeZI7'><center id='CeZI7'></center></pre></bdo></b><th id='CeZI7'></th></span></q></dt></tr></i><div id='CeZI7'><tfoot id='CeZI7'></tfoot><dl id='CeZI7'><fieldset id='CeZI7'></fieldset></dl></div>