TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

In MySQL, never use “utf8”. Use “utf8mb4”

45 pointsby suresh70over 5 years ago

3 comments

miklover 5 years ago
MySQL is a great example how extreme commitment to backwards compatibility makes your whole product backwards.<p>It is chock full of bugs and footguns that you can work around and mitigate if you know how to configure it correctly, but most of those improvements are still not the default.<p>And the `utf8` encoding, that does not fully support UTF-8 looks like it’ll stay around forever. ಠ_ಠ<p>As the author of the post says, much better to just use PostgreSQL, will save you a lot of headaches down the road.
评论 #21451830 未加载
评论 #21470250 未加载
评论 #21452591 未加载
donalhuntover 5 years ago
previous discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17310690" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17310690</a><p>additional context (which the OP didn&#x27;t reference):<p><a href="https:&#x2F;&#x2F;mysqlserverteam.com&#x2F;mysql-8-0-when-to-use-utf8mb3-over-utf8mb4&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mysqlserverteam.com&#x2F;mysql-8-0-when-to-use-utf8mb3-ov...</a><p><a href="https:&#x2F;&#x2F;mysqlserverteam.com&#x2F;sushi-beer-an-introduction-of-utf8-support-in-mysql-8-0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mysqlserverteam.com&#x2F;sushi-beer-an-introduction-of-ut...</a><p><a href="https:&#x2F;&#x2F;dev.mysql.com&#x2F;doc&#x2F;refman&#x2F;5.5&#x2F;en&#x2F;charset-unicode-utf8mb3.html" rel="nofollow">https:&#x2F;&#x2F;dev.mysql.com&#x2F;doc&#x2F;refman&#x2F;5.5&#x2F;en&#x2F;charset-unicode-utf8...</a><p>hint: &quot;Exactly the same set of characters is available in utf8mb3 and ucs2.&quot;
pwinnskiover 5 years ago
&quot;Never&quot; seems an odd choice. Until somewhat recently the recommendation would have been the now-deprecated &quot;utf8mb3&quot; for which &quot;utf8&quot; is a synonym.<p>Until the next release, when &quot;utf8&quot; is updated to be a synonym for &quot;utf8mb4&quot;, yes, use &quot;utf8mb4&quot; directly. At the next release, you can use &quot;utf8&quot; again.