Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MySQL 8
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
とみたまさひろ
May 23, 2018
Technology
0
110
MySQL 8
MySQL Innovation Day Tokyo 2018/5/23 のスライド
とみたまさひろ
May 23, 2018
Tweet
Share
More Decks by とみたまさひろ
See All by とみたまさひろ
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.7k
文字列の並び順 / Unicode Collation
tmtms
4
960
夢の印税生活 / Life on Royalties
tmtms
0
550
文字列の並び順 / String Collation
tmtms
1
190
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
980
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
1.4k
Ruby on Browser
tmtms
1
2.1k
私のRSpecの書き方 / How I write RSpec
tmtms
5
2.2k
ショートカットと端末 / shortcut & terminal
tmtms
2
1k
Other Decks in Technology
See All in Technology
スピンアウト講座05_実践活用事例
overflowinc
0
340
AI時代のオンプレ-クラウドキャリアチェンジ考
yuu0w0yuu
0
100
WebアクセシビリティをCI/CDで担保する ― axe DevTools × Playwright C#実践ガイド
tomokusaba
2
200
イベントで大活躍する電子ペーパー名札を作る(その2) 〜 M5PaperとM5PaperS3 〜 / IoTLT @ JLCPCB オープンハードカンファレンス
you
PRO
0
150
Phase04_ターミナル基礎
overflowinc
0
700
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
1
110
GCASアップデート(202601-202603)
techniczna
0
240
生成AI活用でQAエンジニアにどのような仕事が生まれるか/Support Required of QA Engineers for Generative AI
goyoki
1
340
バクラク最古参プロダクトで重ねた技術投資を振り返る
ypresto
0
200
Phase05_ClaudeCode入門
overflowinc
0
630
スピンアウト講座03_CLAUDE-MDとSKILL-MD
overflowinc
0
370
VPCエンドポイント意外とお金かかるなぁ。せや、共有したろ!
tommy0124
1
720
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
Chasing Engaging Ingredients in Design
codingconduct
0
150
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
91
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
The untapped power of vector embeddings
frankvandijk
2
1.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Navigating Team Friction
lara
192
16k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Transcript
MySQL 8 MySQL 8 MySQL Innovation Day Tokyo 2018/05/23 とみたまさひろ
1
自己紹介 自己紹介 とみたまさひろ 日本MySQLユーザ会 趣味 文字化け MySQLプロトコル http://tmtms.hatenablog.com http://twitter.com/tmtms 2
MySQL 8 🎉🎉🎉 MySQL 8 🎉🎉🎉 3
MySQL 8 多くの新機能がありますが… 4
MySQL恒例「RCとはいったい…」案件 MySQL恒例「RCとはいったい…」案件 5
utf8の指定でwarning utf8の指定でwarning mysql> set names utf8; Query OK, 0 rows
affected, 1 warning (0.00 sec) Warning (Code 3719): 'utf8' is currently an alias for r set UTF8MB3, which will be replaced by UTF8MB4 in a se. Please consider using UTF8MB4 in order to be unamb 6
mysqlshのプロンプトが派手に mysqlshのプロンプトが派手に 7
MySQL Parameters MySQL Parameters バージョン間のパラメータ値を比較 https://tmtm.github.io/mysql-params 5.7 と 8.0 の比較
8
文字コードまわり 文字コードまわり 9
ujis,sjis,eucjpms,cp932 はもう要らない ujis,sjis,eucjpms,cp932 はもう要らない (個人の感想です) (個人の感想です) 10
Default Charset Default Charset 5.7 latin1 ISO8859-1 (欧米の文字) 8.0 utf8mb4
Unicode (世界中の文字) デフォルトのままで日本語や絵文字が使える 11
utf8mb4 Collations utf8mb4 Collations 文字の照合規則 日本語環境で使われそうなもの utf8mb4_bin utf8mb4_general_ci (5.7 デフォルト)
utf8mb4_unicode_ci utf8mb4_unicode_520_ci utf8mb4_0900_ai_ci (8.0 デフォルト) utf8mb4_0900_as_ci utf8mb4_0900_as_cs utf8mb4_ja_0900_as_cs utf8mb4_ja_0900_as_cs_ks 12
Collation name Collation name bin コードのまま general MySQL独自規則 unicode Unicode
4.0.0 unicode_0520 Unicode 5.2.0 0900 Unicode 9.0.0 ja_0900 Unicode 9.0.0 + 日本語 13
Collation name Collation name ai Accent Insensitive as Accent Sensitive
ci Case Insensitive cs Case Sensitive ks Kana Sensitive 14
デフォルトCollationの違い デフォルトCollationの違い 5.7: utf8mb4_general_ci A=a, A=a, や≠ゃ は≠ぱ≠ば あ≠ア 🍣=
🍺 8.0: utf8mb4_0900_ai_ci A=a, A=a, や=ゃ は=ぱ=ば あ=ア 🍣≠ 🍺 15
Charset=utf8mb4 を指定しただけでは Charset=utf8mb4 を指定しただけでは 5.7 と 8.0 で動きが異なるので注意 5.7 と
8.0 で動きが異なるので注意 16
新しいCollationたち 新しいCollationたち 17
utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci アクセントの違いを区別しない はは = ぱぱ = ばば 大文字小文字を区別しない びょういん
= びよういん いろは = イロハ 株式会社 = ㍿ 18
utf8mb4_0900_ utf8mb4_0900_as as_ci _ci アクセントの違いを区別する はは ≠ ぱぱ ≠ ばば
大文字小文字を区別しない びょういん = びよういん いろは = イロハ 株式会社 = ㍿ 19
utf8mb4_0900_as_ utf8mb4_0900_as_cs cs アクセントの違いを区別する はは ≠ ぱぱ ≠ ばば 大文字小文字を区別する
びょういん ≠ びよういん いろは ≠ イロハ 株式会社 ≠ ㍿ utf8mb4_bin と同じ?? (違います) 20
utf8mb4_ utf8mb4_ja ja_0900_as_cs _0900_as_cs アクセントの違いを区別する はは ≠ ぱぱ ≠ ばば
大文字小文字を区別する びょういん ≠ びよういん 株式会社 ≠ ㍿ カタカナひらがなを区別しない いろは = イロハ 21
utf8mb4_ja_0900_as_cs_ utf8mb4_ja_0900_as_cs_ks ks アクセントの違いを区別する はは ≠ ぱぱ ≠ ばば 大文字小文字を区別する
びょういん ≠ びよういん 株式会社 ≠ ㍿ カタカナひらがなを区別する いろは ≠ イロハ utf8mb4_0900_as_cs と同じ?? 22
utf8mb4_0900 と utf8mb4_ utf8mb4_0900 と utf8mb4_ja ja_0900 _0900 の違い の違い
23
ソート順 ソート順 mysql> select hex(s),s from ja order by s;
+--------+------+ | hex(s) | s | +--------+------+ | E4BA9C | 亜 | | E4BC8A | 伊 | | E99BA8 | 雨 | | E6A084 | 栄 | | E5A5A5 | 奥 | +--------+------+ 24
長音 長音 mysql> select s from ja order by s;
+--------+ | s | +--------+ | あー | | ああ | | あい | | いあ | | いー | | いい | | うあ | | うい | | うー | +--------+ 25
ja_0900 は JIS順 ja_0900 は JIS順 日本語辞書順 日本語辞書順 26
utf8mb4_0900_as_csが一番無難? utf8mb4_0900_as_csが一番無難? utf8mb4_binでもいいかも utf8mb4_binでもいいかも 27
まとめ まとめ Charsetのデフォルトがutf8mb4で便利! 日本語Collationが増えた! 適切なCollationを使おう! 28