」工欲善其事,必先利其器。「—孔子《論語.錄靈公》
首頁 > 程式設計 > 為什麼我的表情符號不使用UTF8MB4保存在我的MySQL數據庫中?

為什麼我的表情符號不使用UTF8MB4保存在我的MySQL數據庫中?

發佈於2025-03-23
瀏覽:315

Why Are My Emojis Not Saving in My MySQL Database Using utf8mb4?
mysql utf8mb4:在存儲表情符號

時,會發生錯誤時發生錯誤時,您會嘗試將emojis的名稱保存到您的mysql Database中時遇到錯誤,並使用utf8mb4 encododing ancododing ancod. The issue stems from differences in the database-specific variables between the global settings and your specific database.

Database Configuration Verification

Verify that the global database variables are set to "utf8mb4" for "character_set" and "utf8mb4_unicode_ci" for "collat​​ion" using the query:

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collat​​ion%';
  1. For the relevant database, ensure that the above variables are also set to "utf8mb4" and “ UTF8MB4_UNICODE_CI”,分別使用phpmyadmin中的相同查詢。
默認字符集= UTF8MB4 [mysqld] ... 字符集合式手持= false 字符 - 設定服務器= UTF8MB4 Collat​​ion-Server = UTF8MB4_UNICODE_CI
在MySQL會話中,將客戶端,連接和結果字符設置為UTF8MB4,可能解決該問題。
最新教學 更多>

免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。

Copyright© 2022 湘ICP备2022001581号-3