mysql登录时出现的问题

最近登录mysql时出现如下错误:

mysql: Character set 'uft8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
mysql: Character set 'uft8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
ERROR 2019 (HY000): Can't initialize character set uft8 (path: /usr/share/mysql/charsets/)

查阅了很多资料都未能解决,最后想起为了支持中文修改了my.cnf文件。当时在这个文件中添加了如下几行:

[mysqld]
character-set-server=utf8

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

问题恰恰出现在这里,后面指定的utf8必须改为大写。修改如下解决问题。

[mysqld]
character-set-server=UTF8

[client]
default-character-set=UTF8

[mysql]
default-character-set=UTF8