1. 配置/etc/mysql/my.cnf文件
因为客户端使用的是gbk编码,所以在[client]和[mysqld]下都添加如下设置:
default-character-set=gbk
2. 建表时使用如下设置:
CREATE TABLE IF NOT EXISTS `signon` (
`id` int(11) NOT NULL auto_increment COMMENT '系统自动生成的自动递增用户ID',
`username` varchar(16) character set gb2312 NOT NULL COMMENT '用户帐号',
`passwd` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `qq` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk AUTO_INCREMENT=1 ;
2023年1月19日 18:56
"If you find that your MySQL database is returning Chinese characters as garbled text, you can try setting the character set to UTF-8 on the Debian server. This can cbd oil health benefits be done by editing the MySQL configuration file, which is typically located at /etc/mysql/my.cnf. Find the [mysqld] section and add the following lines: character-set-server = utf8 collation-server = utf8_unicode_ci Save the file and restart MySQL for the changes to take effect."
2024年1月14日 17:32
I curious more interest in some of them hope you will give more information on this topics in your next article