I. Background of the problem
After installing 5.6.21 MySQL, there is a coding problem.
Show variables like '%character% '; display character_set_database and character_set_server values are latin1;
By set character_set_server= ' UTF8 ', again the view is actually utf8, but there are still coding errors,
After restarting the MYSQLD service, review the value of the variable and revert to latin1.
Ii. process of Settlement
Edit the My.cnf file.
<!-- lang: shell -->[mysqld]default-character-set=utf8
Restart Mysqld. Cannot restart after shutdown, view error log ***.local.err file.
<!-- lang: shell -->2015-05-08 00:52:49 58000 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable ‘default-character-set=utf8‘2015-05-08 00:52:49 58000 [ERROR] Aborting
Confirm that the word is not spelled correctly.
Third, problem solving
Search Discovery
Default-character-set This attribute is obsolete in mysql5.0, 5.5.3 removed.
Http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_default-character-set
Revision changed to
<!-- lang: shell -->[mysqld]character-set-server=utf8
Restart Mysqld, encoding problem solved.
mysql5.5.3 and above modify default encoding after start failure