MySQL ‘Disappearing Table’ Issue Caused by Zero‑Width Characters
This article explains how an invisible zero‑width Unicode character embedded in a MySQL table name can make the table appear to disappear, demonstrates the problem with reproducible examples, analyzes the root cause, and provides practical steps to detect and fix such issues.
Introduction: In MySQL usage, even a tiny invisible character can cause serious problems; this article shares a reproduction case of a “disappearing table” caused by a zero‑width character.
Problem description: A table lang was created in database test . SHOW TABLES; listed the table, but SELECT * FROM lang; returned “ERROR 1146 (42S02): Table 'test.lang' doesn't exist”.
Root cause analysis: The table name actually contained a zero‑width space (U+200B) after the name, which is invisible in most editors. The character can be seen when copying the CREATE statement into tools that highlight such characters.
What are zero‑width characters? They are Unicode characters that occupy no visible space, such as U+200B zero‑width space, often used for data obfuscation, but they can break SQL syntax.
Solution steps:
Before creating tables, paste the DDL into multiple text editors that can reveal hidden symbols (e.g., Sublime Text, VS Code with plugins) to detect abnormal characters.
After creation, run SHOW CREATE TABLE; and inspect the output for hidden symbols.
When using the MySQL client, the column border “|” for a table name containing a zero‑width space is misaligned, which can help spot the issue.
Conclusion: Zero‑width characters are an invisible trap that can cause seemingly unsolvable MySQL problems. By understanding their nature, carefully checking SQL statements, avoiding blind copy‑paste from untrusted sources, and using appropriate tools, such issues can be prevented.
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.