mysql 5.5字符集问题_MySQL
程序员文章站
2022-06-08 11:14:27
...
bitsCN.com
安装了个5.5版本的mysql,字符集出现了问题,之前的mysql服务器都是通过在my.cnf配置文件中进行配置便可,可是今儿怎么着都不行一直报错:
当时系统中也没有配置错误日志,所以只能是先配置下错误日志的位置,看看到底是哪里出错了:
[html] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp log-error=/var/log/mysql/error.log lc-messages-dir = /usr/share/mysql skip-external-locking default-character-set=utf8 结果查看了错误日志才发现是字符集的错误: [html] [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8' 居然不认识,上网上了找了下发现也有人遇到了,说是5.5中mysql不再使用default-character-set这种写法了。具体请看:http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_default-character-set
把default-character-set=utf8 改成: character-set-server=utf8就可以了。 [html] root@chenDBA:/etc/mysql# vim my.cnf root@chenDBA:/etc/mysql# service mysql start mysql start/running, process 5904 root@chenDBA:/etc/mysql# mysql -uroot -p Enter password: mysql> show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) OK收工了。 作者 chen861201 bitsCN.com
安装了个5.5版本的mysql,字符集出现了问题,之前的mysql服务器都是通过在my.cnf配置文件中进行配置便可,可是今儿怎么着都不行一直报错:
当时系统中也没有配置错误日志,所以只能是先配置下错误日志的位置,看看到底是哪里出错了:
[html] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp log-error=/var/log/mysql/error.log lc-messages-dir = /usr/share/mysql skip-external-locking default-character-set=utf8 结果查看了错误日志才发现是字符集的错误: [html] [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8' 居然不认识,上网上了找了下发现也有人遇到了,说是5.5中mysql不再使用default-character-set这种写法了。具体请看:http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_default-character-set
把default-character-set=utf8 改成: character-set-server=utf8就可以了。 [html] root@chenDBA:/etc/mysql# vim my.cnf root@chenDBA:/etc/mysql# service mysql start mysql start/running, process 5904 root@chenDBA:/etc/mysql# mysql -uroot -p Enter password: mysql> show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) OK收工了。 作者 chen861201 bitsCN.com
上一篇: Python(十)文件存储
推荐阅读
-
mysql报错1033 Incorrect information in file: ‘xxx.frm’问题的解决方法
-
phpstudy2018升级MySQL5.5为5.7教程(图文)
-
mysql启动时出现ERROR 2003 (HY000)问题的解决方法
-
Mysql5.7中使用group concat函数数据被截断的问题完美解决方法
-
Mysql数据库从5.6.28版本升到8.0.11版本部署项目时遇到的问题及解决方法
-
关于mysql优化问题的原理和技巧讲解
-
解析MySQL隐式转换问题
-
linux下mysql乱码问题的解决方案
-
解决mysql本地数据库不能用ip访问的问题
-
Ubuntu下出现Mysql error(2002)问题的解决方法