创建带有显式默认字符集的mysql表,如果我没有? [英] Creating mysql table with explicit default character set, what if I don't?
本文介绍了创建带有显式默认字符集的mysql表,如果我没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在mysql 5.x如果我做这样的事情有什么区别:
In mysql 5.x Whats the difference if I do something like this:
CREATE TABLE aTable (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
aNumber bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
:
CREATE TABLE aTable (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
aNumber bigint(20) DEFAULT NULL
) ENGINE=InnoDB CHARACTER SET=utf8;
注意我没有在第一个字符集中指定字符集为默认值。我在mysql文档中找不到任何东西。
Notice I am not specifying the character set as default in the first one. I couldn't find anything in the mysql docs.
推荐答案
单词 DEFAULT
请参阅MySQL文档中的 CREATE TABLE 。以下是相关位:
See the MySQL documentation for CREATE TABLE. Here's the relevant bit:
table_option:
ENGINE [=] engine_name
... other options ...
| [DEFAULT] CHARACTER SET [=] charset_name
... more options ...
您可以使用 SHOW CREATE TABLE 命令。
这篇关于创建带有显式默认字符集的mysql表,如果我没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文