Error 1088 (ER_ALTER_INFO) is an informational warning that shows how many records were processed and how many duplicate rows were found while running an ALTER TABLE statement.
MySQL Error 1088: ER_ALTER_INFO appears after ALTER TABLE operations and simply reports the number of affected records and duplicates. It is not fatal, but duplicates can block adding UNIQUE keys. Eliminate duplicates, re-run ALTER TABLE, or ignore the note if no uniqueness change is required.
Records: %ld Duplicates: %ld
MySQL raises ER_ALTER_INFO (error code 1088, SQLSTATE HY000) as a note after executing ALTER TABLE operations that scan or rewrite the table. The server prints text like "Records: 135 Duplicates: 2" to report how many rows were copied and how many duplicate keys it found.
The message is informational, but it can signal a problem when you add a PRIMARY KEY or UNIQUE index.
If duplicates exist, the ALTER statement may drop rows or abort, depending on the SQL mode. Treating the note as an error in client libraries can also interrupt automated pipelines.
Adding a UNIQUE or PRIMARY KEY constraint forces MySQL to check every row for duplicates. When duplicates are detected, ER_ALTER_INFO lists them.
In strict SQL mode the operation fails; in non-strict mode MySQL keeps the first row and flags the rest as duplicates.
Converting column types, changing ROW_FORMAT, or using ALGORITHM=COPY triggers a full table rewrite. MySQL then prints the record/duplicate summary even if no uniqueness change occurs.
First interpret the message. If Duplicates = 0, no action is needed.
If duplicates are present and you require a UNIQUE key, eliminate them before re-running ALTER TABLE. Use a temporary table or DELETE with window functions (MySQL 8.0+) to keep one row per key.
If your application treats notes as errors, adjust the client to ignore SQLSTATE HY000 with error code 1088, or run SET sql_notes = 0 before the DDL.
Always re-enable notes afterward.
Creating a UNIQUE(email) index on a users table fails because two users share the same email. Remove or merge the duplicate rows, then execute the ALTER again.
Changing a table’s ROW_FORMAT triggers ER_ALTER_INFO even without duplicates. Ignore the note or disable it during migration scripts.
Enforce data uniqueness when the table is first created.
Define PRIMARY KEY and UNIQUE constraints early so duplicates never accumulate.
Use SELECT key_column, COUNT(*) FROM tbl GROUP BY key_column HAVING COUNT(*) > 1 to monitor for duplicates. Schedule the query in Galaxy and share results with your team to act before DDL operations.
1062 – ER_DUP_ENTRY: Raised when an INSERT or UPDATE violates a UNIQUE key.
Remove duplicates or change the value.
1022 – ER_DUP_KEYNAME: Happens when adding an index with a name that already exists. Rename the index.
1265 – ER_WARN_DATA_TRUNCATED: Appears with ALTER TABLE when data is cut. Increase column size or cleanse data.
.
No. ER_ALTER_INFO is an informational note. It becomes critical only if duplicates block a UNIQUE index.
Run SET sql_notes = 0 before the ALTER TABLE and SET sql_notes = 1 afterward.
Some drivers treat any server message with SQLSTATE HY000 as an error. Configure your ORM or driver to ignore code 1088.
Yes. Save the duplicate-finding query in a Galaxy Collection. Team members can run it anytime to keep the table clean.