开发者

Change server variable character_set_server

I want to change the mys开发者_高级运维ql server variable character_set_server to utf8. I have googled on this but can't seem to find the information I'm looking for or the instructions don't match. It seems I need to edit a file called my.cnf but this file does not exist on my system. The version is 5.1.36.


this is first result from google

http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_character-set-server

there are two ways to set this configuration

  • via configuration file (character-set-server), required restart
  • or via set global/session character_set_server, this does not require restart, BUT if your database restarted, it will gone, then you will need to set this again


Locations of the my.ini and my.cnf files:

http://dev.mysql.com/doc/refman/5.0/en/option-files.html

As to the question whether you should use my.ini or my.cnf files, the above documentation states that

Windows systems use both my.ini and my.cnf,

Linux, Unix, Mac OS X systems use my.cnf.


Run this query:

set global character_set_server = utf8;

then restart mysql. you can see the list of all your variables with a simple

show variables;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜