A solution for inserting garbled characters in MySQL programming under Linux _php tutorial

Source: Internet
Author: User
Inserting Chinese is garbled, tried a lot of methods, such as I first set the VIM to: set Fileencoding=utf-8 does not work, and then think about, and vim has nothing to do with
Then try C # code, using the Encoding.UTF8.GetString () method, and then not.
I was depressed, suddenly remembered to could there be MySQL setup problem???
So, sudo nano/etc/mysql/my.cnf
Insert the following red code, Default-character-set = UTF8, success, not garbled ~ ~ ~ No encoding ...
# This is formally known as [Safe_mysqld]. Both versions is 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

http://www.bkjia.com/PHPjc/318002.html www.bkjia.com true http://www.bkjia.com/PHPjc/318002.html techarticle inserting Chinese is garbled, tried a lot of methods, such as I first set the VIM to: Setfileencoding=utf-8 does not work, and then think about it, and vim has nothing to do with the C # code, ...

  • 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.