Converting utf8mb3 to utf8mb4: A Guide

Опубликовано: 19 Июнь 2023
на канале: Database Dive
223
0

In this utf8mb3 vs utf8mb4 tutorial video I'll show you how to convert utf8mb3 to utf8mb4. Enjoy!

SQL queries used in the video:

1) Set a character set and collation across the entire SQL database:
ALTER DATABASE dbname CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

2) Set a character set and collation across a table:
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

3) Set a character set and collation for a specific column:
ALTER TABLE tablename CHANGE col_1 col_1 VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Replace "dbname" and "tablename" with your SQL database and table names. Also if you're changing the collation of a column, make sure to alter the amount of characters that can be stored in the column if necessary.

Enjoy the video!

Music:
Skysurf - Pold:    • Skysurf – Pold (No Copyright Music)  
Licensed under a Creative Commons Attribution license: https://creativecommons.org/licenses/...
Free Download / Stream: https://bit.ly/3qiqwKX
Music promoted by Audio Library:    • Skysurf – Pold (No Copyright Music)  

#shorts #database #mysql #web #webdevelopment #reels #sql #developer