12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-29 10:10:31
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
打开安装目录下的my.ini文件我的是:C:\Program Files\MySQL\MySQL Server 5.5下面,修改如下:[client]default-character-set=utf8port=3306[mysql]#网上下面这个 gbk 很多回答
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
打开安装目录下的my.ini文件
我的是:C:\Program Files\MySQL\MySQL Server 5.5下面,修改如下:
[client]default-character-set=utf8port=3306[mysql]#网上下面这个 gbk 很多回答也是设置为utf8,结果就是乱码default-character-set=gbk# SERVER SECTION# ----------------------------------------------------------------------## The following options will be read by the MySQL Server. Make sure that# you have installed the server correctly (see above) so it reads this # file.#[mysqld]# The TCP/IP Port the MySQL Server will listen onport=3306#Path to installation directory. All paths are usually resolved relative to this.basedir="C:/Program Files/MySQL/MySQL Server 5.5/"#Path to the database rootdatadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"# The default character set that will be used when a new schema or table is# created and no character set is definedcharacter-set-server=utf8collation-server=utf8_general_ci修改完毕重启mysql,查看一下编码:mysql> show variables like 'character_set%';+--------------------------+---------------------------------------------------------+| Variable_name | Value |+--------------------------+---------------------------------------------------------+| character_set_client | gbk || character_set_connection | gbk || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | gbk || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ |+--------------------------+---------------------------------------------------------+操作试试:mysql> insert into per values('乱码解决');Query OK, 1 row affected (0.00 sec)mysql> select * from per;+--------------+| name |+--------------+| 的纷纷从 || 乱码解决 |+--------------+3 rows in set (0.00 sec)
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19