Linux in the MySQL programming when inserting Chinese garbled solution _php tips

Source: Internet
Author: User
Insert Chinese is garbled, tried a lot of methods, such as I first set vim setting to: Set Fileencoding=utf-8 does not work, then think about it, and vim does not matter
Then try the C # code, using the Encoding.UTF8.GetString () method, and then it's not right.
I was depressed, suddenly remembered to order MySQL setup problem???
So, sudo nano/etc/mysql/my.cnf
Insert the following red code, Default-character-set = UTF8, success, not garbled ~ ~ ~ Nothing encoding ...
# This is formally known as [Safe_mysqld]. Both versions are currently parsed.
[Mysqld_safe]
Socket =/var/run/mysqld/mysqld.sock
Nice = 0
[Mysqld]
#
# * Basic Settings
#
user = MySQL
Pid-file =/var/run/mysqld/mysqld.pid
Socket =/var/run/mysqld/mysqld.sock
Default-character-set = UTF8
Port = 3306
Basedir =/usr
DataDir =/var/lib/mysql
Tmpdir =/tmp
Language =/usr/share/mysql/english
Skip-external-locking

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.