Mysql cannot be started because of modifying the my. cnf file in ubuntu.

Source: Internet
Author: User


Ubuntu modify my. the cnf file causes mysql to fail to start. Recently, mysql was configured on the Virtual Machine. After installation, the character set is displayed as show variables like 'character % '; + bytes + | Variable_name | Value | www.2cto.com + bytes + | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | latin1 | bytes | binary | utf8 | | character_set_server | latin1 | character_set_system | utf8 | character_sets_dir |/usr/share/mysql/charsets/| + ---------------------- + bytes +
First, you need to change all to utf8, and modify the mysql STARTUP configuration file according to the online prompt my. the basic steps for cnf online are: Find [client] and add: default-character-set = utf8 // The default character set is utf8 www.2cto.com. Find [mysqld] and add: // The default character set is utf8 default-character-set = utf8 // set utf8 encoding when connecting to the mysql database to run the mysql database as utf8
Init_connect = 'set NAMES utf8'. However, after the modification, I started the mysql service and reported an error. I failed to start the mysql service and tried a variety of solutions online. I did not solve the problem. Finally, I found a solution to solve the problem, as shown below: others are the same as above. Only default-character-set = utf8 added under [mysqld] is changed to character-set-server = utf8 to restart mysql, start successfully and check the code as: www.2cto.com
+ Bytes + | Variable_name | Value | + bytes + | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | utf8 | bytes | binary | utf8 | | character_set_server | utf8 | character_set_system | utf8 | character_sets_dir |/usr/share/mysql/charsets/| + ---------------------- + bytes +

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.