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

初始化mysql数据库时提示字符编码错误的解决办法

2024/3/27 18:57:24发布5次查看
有时候在安装完数据库并初始化的时候会出现如下错误:
root@localhost mysql-5.5.19]# bash scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/home/webserver/mysqldata/
installing mysql system tables...
120330 16:19:42 [error] unknown collation: 'utf8-general_ci'
120330 16:19:42 [error] aborting
120330 16:19:42 [note] /usr/local/mysql/bin/mysqld: shutdown complete
installation of system tables failed!  examine the logs in
/home/webserver/mysqldata/ for more information
造成这种错误原因是在配置参数时utf8-general_ci写错了,应该是utf8_general_ci,
如果不想重新安装数据库那就在my.cnf文件中[mysqld]下面增加一行:
character_set_server=utf8
固原分类信息网,免费分类信息发布

VIP推荐

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