Troubleshooting MySQL Configuration Error Caused by Hidden Unicode Space
This article explains how a hidden non‑breaking space character copied from documentation caused the MySQL lower_case_table_names parameter to be unrecognizable, details the reproduction steps, and presents three methods (hexdump, od, editor) to detect and resolve such encoding issues.
1 Background Information
The client needed to migrate database data to the DMP platform and added the parameter lower_case_table_names=0 to the MySQL configuration, but the database failed to start.
mysql-error.log
...........
2023-08-23T15:22:01.554471+08:00 0 [Note] Plugin 'FEDERATED' is disabled.
2023-08-23T15:22:01.557909+08:00 0 [Note] Semi-sync replication initialized for transactions.
2023-08-23T15:22:01.557926+08:00 0 [Note] Semi-sync replication enabled on the master.
2023-08-23T15:22:01.557976+08:00 0 [ERROR] unknown variable 'lower_case_table_names
= 0'
2023-08-23T15:22:01.557982+08:00 0 [Note] Starting ack receiver thread
2023-08-23T15:22:01.557987+08:00 0 [ERROR] Aborting
...........Analysis
Commenting out the added parameter allowed MySQL to start, indicating the problem lay with the parameter itself. Re‑typing the same parameter manually resolved the issue, confirming that the copied text contained hidden characters.
# cat /opt/mysql/etc/4444/my.cnf |tail -n 3
#lower_case_table_names = 0
lower_case_table_names = 0
systemctl restart mysqld_4444.service2 Local Reproduction
After pasting the parameter into the configuration file and restarting, MySQL failed to start with the same error.
# cat /opt/mysql/etc/4444/my.cnf |tail -n 2
lower_case_table_names = 0
systemctl restart mysqld_4444.service
... (error log shown) ...Manually typing the parameter and restarting succeeded, proving the hidden character issue.
# cat /opt/mysql/etc/4444/my.cnf |tail -n 2
#lower_case_table_names = 0
lower_case_table_names = 0
systemctl restart mysqld_4444.service
ps -ef |grep mysqldMethod 1: hexdump
Using hexdump reveals a special space (302 240) before the ‘=’ sign, which is a non‑breaking space (UTF‑8) incompatible with ASCII.
Method 2: od
The od command shows the same 302 240 byte sequence, confirming the presence of the non‑breaking space.
Method 3: Editor
Opening the file in Sublime Text with UTF‑8 encoding highlights the special character <0xa0> , identified as a Unicode non‑breaking space.
3 Summary
When adding parameters to MySQL configuration files, avoid copying directly from documents or web pages; hidden non‑breaking spaces can cause startup failures. Prefer using platform tools (e.g., DMP) or manually typing parameters, and always verify the file encoding before restarting.
If large numbers of parameters must be pasted, inspect the pasted content for special characters before restarting.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.