简体   繁体   English

如何使用WampServer更改默认的MySQL数据库/表默认的COLLATION?

[英]How to change default MySQL database/table default COLLATION using WampServer?

just want to ask about my problem. 只想问我的问题。 My problem is everytime I created a database. 我的问题是每次创建数据库时。 It's default collation is always set to ' latin1_swedish_ci '. 它的默认排序规则始终设置为“ latin1_swedish_ci ”。 But what I want is set this to ' utf8_general_ci ' in DEFAULT . 但是我要在DEFAULT中将其设置为' utf8_general_ci '。 I also added this to my my.ini file in mysql: 我还将此添加到mysql中的my.ini文件中:

character-set-server=utf8    
collation-server=utf8_general_ci

But it is default in latin1_swedish_ci . 但这是latin1_swedish_ci中的默认值

According to the manual , the my.ini is just about the only place where you cannot change this setting. 根据手册my.ini唯一无法更改此设置的地方。 You can either: 您可以:

  1. Change the startup parameters - pass ---character-set-server=latin1 etc. to the startup invocation. 更改启动参数-将---character-set-server=latin1等传递给启动调用。
  2. Recompile with a different default - probably not really practical with WAMP 使用不同的默认值重新编译-使用WAMP可能不太实际
  3. Change the values at runtime. 在运行时更改值。 This only changes them for the session though, and is as such rather pointless for these config values. 但是,这仅会更改会话中的配置,因此对于这些配置值来说毫无意义。

I'd look into option 1 for a local WAMP machine. 我将研究本地WAMP机器的选项1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM