<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>

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

      How to alter a column and change the default value?(如何更改列并更改默认值?)
    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 '{}';
                

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

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                SQL query to group by day(按天分组的 SQL 查询)
                What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

                  <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>

                            <tbody id='r2sTX'></tbody>