MySQL cannot display Chinese under Fedora

Source: Internet
Author: User

Use of the system is fedora22, in the MYSQ official website in accordance with the steps used by the command DNF installed MySQL, in use, the direct creation of a database, Chinese is a question mark;

To view the encoded commands for a database:

Show variables like ' character% ';

The following is the encoding format that should be set after Utf-8.


Workaround: Modify the my.cnf file, this file in/etc/my.cnf, you can use the command: GEDIT/ETC/MY.CNF

When I open it, it's like this,

This is correct, I added three rows of data inside:
Collation-server = Utf8_unicode_ci
init-connect= ' SET NAMES UTF8 '
Character-set-server = UTF8

This is the three lines. After you add it, you need to restart the database. Also, the databases that you created before are all out of use, and you must delete the re-create database before you can display Chinese.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MySQL cannot display Chinese under Fedora

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.