Setting up database chars et

Subject:

CREATE DATABASE DatabaseName (CHARACTER SET utf8DEFAULT CHARACTER SET utf8COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci;

To create a table:

CREATE TABLE TableName (id INT UNSIGNED NOT NULL AUTO_INCREMENT, user VARCHAR(20) DEFAULT NULL

) PRIMARY KEY(id))

ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COLLATE utf8_general_ci; 

2015-09-19 10:54:29gstlouis

To alter an existing database:

ALTER DATABASE DatabaseName CHARACTER SET

DEFAULT CHARACTER SET COLLATE DEFAULT COLLATE

To alter an existing table:

ALTER TABLE TableName DEFAULT CHARACTER SET

COLLATE

utf8, utf8, utf8_general_ci, utf8_general_ci;

utf8, utf8_general_ci;

gstlouis
vote
2015-09-19 10:54:49