drwf69817 2016-10-11 18:17
浏览 194
已采纳

使用utf8mb4的PHP / mysql站点不能正确地从数据库中检索表情符号,尽管在任何地方都指定了utf8mb4,我可以找到它来放置它

I converted my mysql 5.7 database to utf8mb4 today.

As a test, I've put a poo emoji (

  • 写回答

1条回答 默认 最新

  • dongzanghong4379 2016-10-12 08:19
    关注

    The problem was an outdated version of Navicat. Upgrading from 8 to 11 has fixed my issues. I realised this was probably the cause when I discovered that emojis INSERTed via php were correctly stored and retrieved in PHP, but wouldn't show correctly in Navicat.

    Similarly the opposite was true; emojis set in Navicat would correctly store and retrieve in Navicat, but not in PHP.

    Looking at the encoding options for navicat connections, it had a checkbox for "use mysql encoding", but if left unchecked the dropdown of possible options included only utf8, not utf8mb4. I guess navicat 8 pre-dates that being in common usage.

    A quick upgrade, and everything works perfectly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R