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.