mysql:在数据库级别设置字符集和排序规则
我想将字符集和排序规则设置为数据库,以便任何未指定排序规则创建的新表都将具有此排序规则。
我听说这是可能的。是吗? 是否可以通过代码或仅通过配置文件来完成? 如果可以通过代码实现,如何实现?
谢谢
I'd like to set charset and collation to the db, such that any new table created with no collation specified will have this collation.
I heard it's possible. Is it?
Is it possible to do it by means of code or only from configuration files?
If it is possible by means of code, how?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://dev.mysql.com/doc/refman/5.0 /en/charset-configuration.html
要处理代码,我相信您只需确保在应用程序加载开始时设置字符集(我认为这不是您的答案)正在寻找)。
http://dev.mysql.com/doc/refman/5.0/en/charset-configuration.html
To do with code, I believe you would just have to make sure to set the character set at the beginning of your application loads (which I don't think is the answer you're looking for).