How to create database mysql utf8?

379    Asked by AlGerman in SQL Server , Asked on Oct 4, 2022

 I'm new to MySQL and I would like to know:


How can I create a database with charset utf-8 like I did in navicat?


create mydatabase;

...seems to be using some kind of default charset.


Answered by Amy Avery

To create database mysql utf8 -


Try this:

CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;

For more information, see Database Character Set and Collation in the MySQL Reference Manual.



Your Answer

Interviews

Parent Categories