0

When trying to import a database from a .mysql file, I get an error:

ERROR 1115 (42000) at line 24: Unknown character set: 'ascii'

The part the error occurs at is from columns using ASCII:

`column` varchar(64) CHARACTER SET ascii NOT NULL

I checked in /usr/share/mariadb/charsets/, and ascii.xml is there. ASCII is listed in the Index.xml as well. However, when looking at the database it's not:

MariaDB [db]> show character set;
+---------+------------------+---------------------+--------+
| Charset | Description      | Default collation   | Maxlen |
+---------+------------------+---------------------+--------+
| big5    |                  | big5_chinese_ci     |      2 |
| latin1  |                  | latin1_swedish_ci   |      1 |
| latin2  |                  | latin2_general_ci   |      1 |
| ujis    |                  | ujis_japanese_ci    |      3 |
| sjis    |                  | sjis_japanese_ci    |      2 |
| tis620  |                  | tis620_thai_ci      |      1 |
| euckr   |                  | euckr_korean_ci     |      2 |
| gb2312  |                  | gb2312_chinese_ci   |      2 |
| cp1250  |                  | cp1250_general_ci   |      1 |
| gbk     |                  | gbk_chinese_ci      |      2 |
| utf8    |                  | utf8_general_ci     |      3 |
| ucs2    |                  | ucs2_general_ci     |      2 |
| utf8mb4 | UTF-8 Unicode    | utf8mb4_general_ci  |      4 |
| utf16   | UTF-16 Unicode   | utf16_general_ci    |      4 |
| utf16le | UTF-16LE Unicode | utf16le_general_ci  |      4 |
| utf32   | UTF-32 Unicode   | utf32_general_ci    |      4 |
| binary  |                  | binary              |      1 |
| cp932   |                  | cp932_japanese_ci   |      2 |
| eucjpms |                  | eucjpms_japanese_ci |      3 |
+---------+------------------+---------------------+--------+
19 rows in set (0.000 sec)

At this point, I don't know what's wrong or how to get the ASCII character set detected and working.

I am using wodby/mariadb with tag MARIADB_TAG=10.5-3.9.5.

4
  • 1
    I suggest using a different docker file for MariaDB.
    – Rick James
    Jan 20 at 23:30
  • replace ascii with binary as a guess.
    – danblack
    Jan 21 at 8:20
  • Isn't utf8 a superset of ASCII? Jan 21 at 10:27
  • I'd rather not change the mysql file. It's exported from Drupal, and Drupal decided to encode some columns with ASCII instead of UTF-8. I need to be able to work with Drupal database and backups.
    – mbomb007
    Jan 21 at 16:23
0

The issue was that I had the following in my docker-compose.yml:

command: >-
  mysqld
    --character-sets-dir='/usr/share/mariadb/charsets'
    --character-set-client-handshake=FALSE

This was wrong, as the directory was actually /usr/share/mysql/charsets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.