How can I adding data to my MySQL mailserver database without getting a "Incorrect string value" error?
Hi all,
I'm configuring my mail server following the Linode tutorial Email with Postfix, Dovecot, and MySQL.
I installer MySQL 8.0.20 and followed the configuration instructions.
Everything is fine until I try to add data to the MySQL database.
I keep getting an error like
ERROR 1366 (HY000): Incorrect string value: '\xA4<b\xD4\xB3\x8F…' for column 'password' at row 1
I understand that should be a Unicode issue, but my database configuration seems to be ok:
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_0900_ai_ci |
| collation_database | utf8mb4_0900_ai_ci |
| collation_server | utf8mb4_0900_ai_ci |
+--------------------------+--------------------+
Can't guess how to fix the issue then. Is there anybody willing to help? :-)
Thanks in advance!
1 Reply
Hey there -
I've not encountered this error myself, so I did some digging around online for you and found a few resources which might be able to help you out.
In both of the following links, it's suggested that your data needs to be UTF-8 encoded and that error suggests that it is not:
How to fix “Incorrect string value” errors?
INSERT gives Error Code: 1366. Incorrect string value
Here's a page that describes UTF-8 encoding:
I hope this helps!