尝试从 .mysql 文件导入数据库时,出现错误:
ERROR 1115 (42000) at line 24: Unknown character set: 'ascii'
发生错误的部分来自使用 ASCII 的列:
`column` varchar(64) CHARACTER SET ascii NOT NULL
我签入/usr/share/mariadb/charsets/,ascii.xml 在那里。ASCII 也列在 Index.xml 中。但是,在查看数据库时,它不是:
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)
在这一点上,我不知道出了什么问题,也不知道如何检测到 ASCII 字符集并使其正常工作。
我正在使用带有 tag的wodby/mariadbMARIADB_TAG=10.5-3.9.5
。
问题是我的 docker-compose.yml 中有以下内容:
这是错误的,因为目录实际上是
/usr/share/mysql/charsets
.