Common SQL Errors

MySQL Error 1088: ER_ALTER_INFO – Records / Duplicates Message Explained and Fixed

Galaxy Team
August 5, 2025

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.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1088?

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.

Error Highlights

Typical Error Message

Records: %ld Duplicates: %ld

Error Type

Execution Warning

Language

MySQL

Symbol

ER_ALTER_INFO

Error Code

1088

SQL State

Explanation

Table of Contents

What is MySQL Error 1088 ER_ALTER_INFO?

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.

What Causes This Error?

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.

How to Fix MySQL Error 1088 ER_ALTER_INFO

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.

Common Scenarios and Solutions

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.

Best Practices to Avoid This Error

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.

Related Errors and Solutions

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.

.

Common Causes

Related Errors

FAQs

Is error 1088 fatal?

No. ER_ALTER_INFO is an informational note. It becomes critical only if duplicates block a UNIQUE index.

How do I disable the message in migration scripts?

Run SET sql_notes = 0 before the ALTER TABLE and SET sql_notes = 1 afterward.

Why does my client throw an exception for 1088?

Some drivers treat any server message with SQLSTATE HY000 as an error. Configure your ORM or driver to ignore code 1088.

Can Galaxy help spot duplicates?

Yes. Save the duplicate-finding query in a Galaxy Collection. Team members can run it anytime to keep the table clean.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo