Common SQL Errors

MySQL Error 1087: ER_LOAD_INFO - Meaning, Causes, and Fixes

Galaxy Team
August 5, 2025

MySQL Error 1087 (ER_LOAD_INFO) is an informational message returned after LOAD DATA that reports how many rows were read, skipped, deleted, and warned.

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 code 1087?

MySQL Error 1087: ER_LOAD_INFO shows the row counts after a LOAD DATA INFILE or LOAD DATA LOCAL INFILE command. It is not a failure but an informational status. Read the result set or enable multiple-result support in your client to suppress the apparent error.

Error Highlights

Typical Error Message

Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld

Error Type

Data Load Error

Language

MySQL

Symbol

ER_LOAD_INFO

Error Code

1087

SQL State

Explanation

Table of Contents

What is MySQL Error 1087: ER_LOAD_INFO?

MySQL raises error code 1087 with the symbolic name ER_LOAD_INFO after executing a LOAD DATA INFILE or LOAD DATA LOCAL INFILE statement. The server returns a message like “Records: 5000 Deleted: 0 Skipped: 0 Warnings: 3.”

The message is informational. It reports how many rows were processed, how many were silently deleted, which were skipped because of duplicate-key conflicts, and how many generated warnings.

Because it ships as an error packet, some connectors mistakenly surface it as an exception.

What Causes This Error?

The server always emits ER_LOAD_INFO once a LOAD DATA statement finishes. No actual failure must occur. Client code that calls query(), exec(), or similar routines may see the packet and raise an exception if it does not expect multiple results.

Another trigger appears when the connection option CLIENT_IGNORE_SPACE is missing.

Some GUI tools interpret the returned packet incorrectly and label it as SQLSTATE HY000 “General error.”

How to Fix MySQL Error 1087

Because ER_LOAD_INFO is informational, the fix lies in handling, not eliminating, the message. Update your client library or application logic so that it accepts multiple result packets and reads the OK packet that follows.

In popular drivers you can disable error-on-warning behavior or catch the specific SQLSTATE HY000 with error code 1087 and treat it as success.

In MySQL CLI, the message displays normally and requires no action.

Common Scenarios and Solutions

Python mysqlclient and MySQLdb raise an exception after LOAD DATA. Wrap the call in try/except and inspect e.args[0]; ignore when it equals 1087.

PHP PDO returns a warning. Call $stmt->nextRowset() or enable PDO::MYSQL_ATTR_MULTI_STATEMENTS to consume the remaining packets.

Best Practices to Avoid This Error

Always test data-load code with the exact driver and server version used in production.

Check that the library supports CLIENT_MULTI_RESULTS.

Prefer LOAD DATA LOCAL INFILE with LOCAL keyword in client-side imports to minimize server-side file permission problems that can coexist with ER_LOAD_INFO.

Related Errors and Solutions

Error 1148 (ER_LOAD_DATA_LOCAL_INFILE_DISABLED) appears when LOCAL is disabled. Enable local_infile system variable or remove LOCAL.

Error 1048 (ER_BAD_NULL_ERROR) fires if a NOT NULL column receives NULL during LOAD DATA. Provide a default or replace separators.

.

Common Causes

Related Errors

FAQs

Is Error 1087 a real failure?

No. It is an informational message produced after a successful LOAD DATA command. Treat it like a status line.

How can I suppress Error 1087 in Python?

Catch MySQLdb.Error, check if error code equals 1087, and ignore it or call cursor.nextset() to read the OK packet.

Does Error 1087 affect transaction rollback?

No. ER_LOAD_INFO does not change transaction state. COMMIT or ROLLBACK continues to work normally.

Can Galaxy help me avoid Error 1087?

Yes. Galaxy’s built-in MySQL driver consumes multi-result packets automatically, so ER_LOAD_INFO never surfaces as an exception inside the editor.

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