2.6.1.17. Changing the database encoding
You can find out the list of available encodings using SQLqueries:
SHOW CHARACTER SET
- Connect to the database with phpMyAdmin or any MySQLclient.
- To change the encoding, follow the appropriate SQLquery:
ALTER DATABASE `title_bases_data` COLLATE comparison; SELECT @@collation_database;
название_базы_data
— Specify the name of the database for which you want to change the encoding.comparison
— specify the required mapping, for exampleutf8mb4_unicode_ci
.
ALTER TABLE `title_tables` COLLATE comparison;
название_tables
— specify the name of the table for which you want to change the encoding.comparison
— specify the required mapping, for exampleutf8mb4_unicode_ci
.
ALTER TABLE `title_tables` CHANGE `title_fields` VARCHAR(40) CHARACTER SET encoding COLLATE comparison;
название_tables
— specify the name of the table in which you want to change the encoding of the specified field.название_fields
— specify the name of the field for which you want to change the encoding.encoding
— specify the required encoding, for exampleutf8mb4
.comparison
— specify the required mapping, for exampleutf8mb4_unicode_ci
.