您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
三六零分类信息网 > 锡林郭勒分类信息网,免费分类信息发布

Mysql插入中文变为全问号???的问题_MySQL

2025/4/22 15:58:25发布6次查看
bitscn.com
mysql插入中文变为全问号???的问题
1、检查并修改mysql的my.ini的配置文件
[mysql]default-character-set=utf8
2、建立数据库是要指定字符集
create database mydb default character set utf8 collate utf8_general_ci;
3、建立数据表示也要指定字符集:
出问题的命令:create table if not exists `mydb` ( `username` varchar(64) not null, `userid` int(11) not null, ) engine=innodb default charset=latin1;正确的命令:create table if not exists `mydb` ( `username` varchar(64) not null, `userid` int(11) not null, ) engine=innodb default charset=utf8;
说明:mysql版本:5.5.24
bitscn.com
锡林郭勒分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录