时间:2021-07-01 10:21:17 帮助过:2人阅读
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
default-character-set=utf8
2.2 Server characterset是没办法在配置文件中修改的,但也不用重装数据库,只需要重新启动配置程序MySQLInstanceConfig.exe就可以了。
C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin\MySQLInstanceConfig.exe
在选择编码的地方选择utf8就可以了,默认的是Latin1。选的二个或者第三个,第二个默认就是UTF8, 第三个手动选UTF8.
第三步:
重启mysql服务
cmd下:
net stop mysql
net start mysql
mysql> use qba_db;
Database changed
mysql> status;
--------------
C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin\mysql.exe Ver 14.12 Distrib 5
.0.67, for Win32 (ia32)
Connection id: 168
Current database: qba_db
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 20 days 11 hours 4 min 19 sec
Threads: 5 Questions: 3224 Slow queries: 0 Opens: 151 Flush tables: 1 Open
tables: 0 Queries per second avg: 0.002
--------------
MySql数据库乱码解决方法
标签: