MySQL Database Character Set and Collation

To change MySQL database char set and collation, run

ALTER DATABASE DB_NAME_HERE CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

To usee current char set and collation, run

USE DB_NAME_HERE;
SELECT @@character_set_database, @@collation_database;

You can specify char set when creating database with following syntax

Advertisement

CREATE DATABASE DB_NAME_HERE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement