簡體   English   中英

mysql alter table add column utf8

[英]mysql alter table add column utf8

有任何想法,如何添加列:

alter table tname add column cname text character set utf8 collate utf8_general_ci if not exists;

這給出了一個錯誤:

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 'if not exists' at line 1

我需要使用utf-8編碼添加新列。

謝謝

這不是ALTER TABLE嘗試的有效語法,

alter table tname add column cname text character set utf8 collate utf8_general_ci;

在為表格指定排序規則時,您一直小心該表格。

alter table table_name add column column_name text character set utf8 COLLATE utf8_unicode_ci DEFAULT NULL comment 'Comment to the attachment file';

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM