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

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

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

      <tfoot id='McxPy'></tfoot>

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

      如何更改列并更改默认值?

      时间:2023-06-01
    2. <legend id='XqIjn'><style id='XqIjn'><dir id='XqIjn'><q id='XqIjn'></q></dir></style></legend>
        <tbody id='XqIjn'></tbody>
      • <small id='XqIjn'></small><noframes id='XqIjn'>

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

          <bdo id='XqIjn'></bdo><ul id='XqIjn'></ul>
        • <tfoot id='XqIjn'></tfoot>

              • 本文介绍了如何更改列并更改默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在尝试更改列的数据类型并设置新的默认值时遇到以下错误:

                ALTER TABLE foobar_data ALTER COLUMN col VARCHAR(255) NOT NULL SET DEFAULT '{}';

                <块引用>

                ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册在第 1 行的 'VARCHAR(255) NOT NULL SET DEFAULT '{}'' 附近使用的语法

                解决方案

                ALTER TABLE foobar_data MODIFY COLUMN col VARCHAR(255) NOT NULL DEFAULT '{}';

                第二种可能性也一样(感谢 juergen_d):

                ALTER TABLE foobar_data CHANGE COLUMN col col VARCHAR(255) NOT NULL DEFAULT '{}';

                I got the following error while trying to alter a column's data type and setting a new default value:

                ALTER TABLE foobar_data ALTER COLUMN col VARCHAR(255) NOT NULL SET DEFAULT '{}';
                

                ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(255) NOT NULL SET DEFAULT '{}'' at line 1

                解决方案

                ALTER TABLE foobar_data MODIFY COLUMN col VARCHAR(255) NOT NULL DEFAULT '{}';
                

                A second possibility which does the same (thanks to juergen_d):

                ALTER TABLE foobar_data CHANGE COLUMN col col VARCHAR(255) NOT NULL DEFAULT '{}';
                

                这篇关于如何更改列并更改默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在不重新启动 MySQL 的情况下启用 MySQL 的慢查询日志? 下一篇:如何获取 MySQL 视图列表?

                相关文章

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

                  <legend id='r2sTX'><style id='r2sTX'><dir id='r2sTX'><q id='r2sTX'></q></dir></style></legend>
                1. <small id='r2sTX'></small><noframes id='r2sTX'>

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