iOS php MySQL supports Unicode emoji insertion question mark question

Source: Internet
Author: User
Tags php mysql
After the internet has said that the Unicode expression needs mysql5.5.3, my version is MySQL 5.5.38 so is supported, only need to follow the following configuration

Then you can restart the

[Client]default-character-set = utf8mb4[mysqld]character-set-server=utf8mb4collation-server=utf8mb4_unicode_ci[ Mysql]default-character-set = Utf8mb4


In addition, the link of PHP also need to change

Define (' DNS ', ' mysql:host=localhost;dbname=test;charset=utf8mb4 ');d efine (' USR ', ' root ');d efine (' PWD ', ' 123456 '); Define (' Maxlifetime ', 1440); try {      $pdo = new PDO (DNS, USR, PWD);} catch (Pdoexception $e) {      throw new exceptio N (' Connection failed: '. $e->getmessage ());}


This is the way to set it. Yes, I used the post submission to receive it.


Reference: http://my.oschina.net/leejun2005/blog/343353

http://bbs.csdn.net/topics/390862460

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