Ubuntu12.04 An error occurred while modifying the mysql configuration file my. cnf encoding-Solution

Source: Internet
Author: User
-------------------------------------------------- | Variable_name | Value | bytes | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 |

-------------------------------------------------- | Variable_name | Value | bytes | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 |

+ -------------------------- + ---------------------------- +
| Variable_name | Value |
+ -------------------------- + ---------------------------- +
| Character_set_client | utf8 |
| Character_set_connection | utf8 |
| Character_set_database | latin1 |
| Character_set_filesystem | binary |
| Character_set_results | utf8 |
| Character_set_server | latin1 |
| Character_set_system | utf8 |
| Character_sets_dir |/usr/share/mysql/charsets/|
+ -------------------------- + ---------------------------- +
8 rows in set (0.00 sec)

The character_set_database and character_set_server encoding still inherit the self-compiled

Directly modify the configuration file my. cnf: [mysqld] and add default-character-set = utf8

$ Sudo service mysql restart

Mysql stop/waiting
Start: Job failed to start
The service cannot start.

Upgrade ubuntu12.04 for the first time.

The simplest way is to add two more configurations under [mysqld ]:

Default-storage-engine = INNODB
Character-set-server = utf8
Collation-server = utf8_general_ci

$ Sudo service mysql start
Mysql start/running, process 22704

$ Mysql-u root-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.01 sec)
The code is removed.

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.