2.6.1.17. Changing the database encoding

You can find out the list of available encodings using SQLqueries:
SHOW CHARACTER SET
  1. Connect to the database with phpMyAdmin or any MySQLclient.
  2. 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 example utf8mb4_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 example utf8mb4_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 example utf8mb4.
    • comparison — specify the required mapping, for example utf8mb4_unicode_ci.
Content