How to Fix MySQL Error 4079 (ER_WARN_DEPRECATED_COLLATION)
You get mysql error 4079 when a query or table uses an outdated collation. To fix it, switch your tables and columns to the modern character set suggested in the warning. The official symbol for this warning is ER_WARN_DEPRECATED_COLLATION, and it uses the HY000 SQL state. The database engine still runs your query, but it logs a warning message. The message tells you that the collation belongs to an old character set. It also tells you which new character set to use instead. Teams should fix th
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 4079 when a query or table uses an outdated collation. To fix it, switch your tables and columns to the modern character set suggested in the warning.
The official symbol for this warning is ER_WARN_DEPRECATED_COLLATION, and it uses the HY000 SQL state. The database engine still runs your query, but it logs a warning message. The message tells you that the collation belongs to an old character set. It also tells you which new character set to use instead. Teams should fix these warnings before the next major database upgrade removes the old character set.
Why mysql error 4079 happens in your database
Database engines update their text rules over time to support more symbols and emojis. Older character sets often miss modern characters or run slower on new hardware. When the database vendor plans to remove an old character set, they mark it as deprecated. Any collation tied to that old character set also becomes deprecated.
You will see mysql error 4079 during several common tasks. It pops up when you create a new table using an old collation rule. It also appears when you alter an existing column or restore an old backup file. Sometimes, a client app sends a session command that sets an old collation upon login. Even if the table uses new settings, that client login step triggers the warning.
Ignoring this warning creates tech debt for your team. In a future version, the database will reject the old collation and break your app. Fixing the root cause early keeps your upgrade path clean and safe.
How to find every deprecated collation in use
Before you change anything, find every place that uses the old collation. Start by reading the exact warning message from your database log. The message names the bad collation, the old character set, and the recommended replacement.
Next, check the system metadata tables in your database. Look at the character set and collation columns for your schemas, tables, and text fields. This check shows you which tables still rely on the old text rules. Do not forget to check stored procedures, views, and triggers as well. These objects keep their own collation rules from the day someone created them.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Finally, review the connection settings in your app code and driver files. Many apps define a character set inside the database URL or startup script. If that setting names the old collation, every new connection will trigger code 4079. Write down every table and app file that needs an update.
How to fix the collation without downtime
Never run blind schema changes on a live production database with broad admin rights. Changing a column collation rewrites the table data and rebuilds the indexes. On a large table, this action locks writes and slows down customer traffic.
First, test the collation change on a staging copy of your data. Check if the new collation changes how the database sorts text or compares strings. Some collations treat upper and lower case letters the same, while others do not. Make sure your unique indexes still work with the new sorting rules. If two rows become equal under the new rule, the table change will fail.
Second, update your app settings so new connections use the new character set. Roll out the table changes during low traffic hours using an online schema tool. Grant the migration tool only the exact permissions needed to alter the target tables. Do not turn off database warnings just to hide the log noise. If your tables hold sensitive data like emails or phone numbers, keep data masking rules active during testing. Masking rewrites matched fields in results so engineers can verify text sorting safely.
Check MySQL queries and results on the wire
MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.
Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.
Frequently asked questions
Does mysql error 4079 stop my queries from running?
No, code 4079 is a warning rather than a hard failure. Your query still finishes, and the database saves or returns your data. Still, future database versions will remove the old collation and cause real errors.
Can I fix the warning by changing only the database default?
Changing the database default only helps new tables that you create later. Existing tables and columns keep their old collation until you alter them directly. You must update both the defaults and the existing columns to clear the warning.
Why do I see this warning when restoring a backup?
Backup files often include the exact character set and collation rules from your old server. When you load that file into a newer server, the engine flags the outdated rules. Update the schema definitions after the restore finishes to clean up the warnings.
Related guides
In this post