php+mysql乱码问题
来源:百度知道 编辑:UC知道 时间:2024/09/23 00:30:42
在MYSQL 数据库的安装目录下 你找到 my.ini的文件 把这快设置一下看看
default-character-set=gb2312
# 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 on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=gb2312
第一行和最后一行两个地方把 编码设置一下