Mysql改变列的排序规则和字符集的信息模式 [英] Mysql change column collation and character set of information schema
问题描述
我想更改系统数据库的列排序规则和字符集information_schema ...
I want to change column collation and character set of system database information_schema...
任何人都可以输入任何有关如何做的输入?是否需要这个
Can anyone give any input on how to do this? Is there any special priviledges i need for this
推荐答案
我知道,你不能运行 ALTER对
命令。相反,你可能想看看 information_schema
中的表执行TABLE character_set _ *
变种。您可以使用 show variables
命令查看哪些变量设置为MySQL服务器中的哪些值:
As far as I know, you cannot run ALTER TABLE
commands on the tables in information_schema
. Instead you will probably want to take a look at the character_set_*
variabes. You can see which variables are set to which values in your MySQL server with a show variables
command:
show variables like "character_set_%";
与MySQL中的元数据相关的变量,例如 information_schema
表,是 character_set_system
变量。我认为 my.cnf
是设置它的正确位置。
The variable that has to do with meta data in MySQL, such as the information_schema
tables, is the character_set_system
variable. I think the my.cnf
is the right place to set it.
此页面上有更多信息: a href =http://dev.mysql.com/doc/refman/5.1/en/charset-metadata.html =noreferrer> UTF-8 for Metadata 。
There's more information on this page: UTF-8 for Metadata.
对于普通表,使用 ALTER TABLE
命令更改表的字符集:
For ordinary tables, you change the character set of a table with an ALTER TABLE
command:
alter table some_table convert to character set utf8;
要执行此操作,您需要具有alter权限。
To do this, you will need the "alter" privilege.
您可以使用 show privileges
命令查看MySQL服务器支持哪些权限,您可以通过 show grants
命令。
You can see which privileges your MySQL server supports with a show privileges
command, and you can see which privileges are granted to your current user with a show grants
command.
这篇关于Mysql改变列的排序规则和字符集的信息模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!