Parsing mysql 5.5 character sets

Source: Internet
Author: User

Mysql 5.5 is installed, and the character set is faulty. The previous mysql servers can be configured in the my. cnf configuration file. However, an error is reported even though this is not the case:

At that time, no error logs were configured in the system, so you can configure the location of the error logs first to see where the error occurred:

Copy codeThe Code is as follows: user = mysql
Pid-file =/var/run/mysqld. pid
Socket =/var/run/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

Only when the error log is viewed is the character set error:
Copy codeThe Code is as follows: [ERROR]/usr/sbin/mysqld: unknown variable 'default-character-set = utf8'

I don't even know it. I went online and looked for it and found that some people also encountered it, saying that mysql in mysql 5.5 no longer uses the default-character-set method.

Please see: http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_default-character-set

Change default-character-set = utf8 to character-set-server = utf8.

Copy codeThe Code is as follows: 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.