English 中文(简体)
Collate information missing when converting a MySQL table from Latin1 to UTF8
原标题:

I m converting an existing table such as this:

CREATE TABLE `example`(`id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
                       `column1` char(32) COLLATE latin1_general_ci NOT NULL 
                           DEFAULT   ,   
                       `column2` char(64) COLLATE latin1_general_ci NOT NULL 
                           DEFAULT   ,
                       PRIMARY KEY (`id`)) 
              ENGINE=MyISAM AUTO_INCREMENT=1 
              DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

to utf8 using the following command:

ALTER TABLE example CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

This seems to work ok, but the resulting table doesn t include any collation information:

CREATE TABLE `example` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
                        `column1` char(32) NOT NULL DEFAULT   ,
                        `column2` char(64) NOT NULL DEFAULT   ,
                        PRIMARY KEY (`id`)
                        ) ENGINE=MyISAM DEFAULT CHARSET=utf8

So my question is, would the missing collate information be a problem? I searched google but couldn t find mention of this anywhere. My understanding of the collate flag is pretty basic ( it matters in some way when comparing the characters in string functions I think?)

thanks

最佳回答

The default collation for the utf8 charset is utf8_general_ci, so it s not displaying it.

问题回答

暂无回答




相关问题
How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...

Explain the Need for Mutexes in Locales, Please

Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...

How does Vistalizer work

How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.

Localized exceptions (within a Struts2 app)

I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...

Rails Globalize plugin help

Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?

热门标签