1. MYSQL5.5的字符集设置:
在配置文件my.cnf或者my.ini的 [mysqld]设置character-set-server即可。
如下:
- [client]
- #linux环境下面设置此值
- default-character-set=utf8
- [mysqld]
- #Path to installation directory. All paths are usually resolved relative to this.
- basedir=”D:/mysql-5.5.13-win32/”
- #Path to the database root
- datadir=”D:/mysql-5.5.13-win32/Data/”
- character-set-server=utf8
2.MySQL5.1以及之前的版本:[mysqld]设置default-character-set
如下:
- [client]
- #linux环境下面设置此值
- default-character-set=utf8
- [mysqld]
- #Path to installation directory. All paths are usually resolved relative to this.
- basedir=”D:/mysql/”
- #Path to the database root
- datadir=”D:/mysql/Data/”
- default-character-set=utf8