Warning
Error Code: 3715

MySQL Error 3715: Reserved SRID Range Conflict

📦 MySQL
📋

Description

This warning indicates that an operation attempted to use or define a Spatial Reference System (SRS) with a Spatial Reference ID (SRID) that MySQL has internally reserved for its system use. Such SRIDs are subject to change or removal during database upgrades without prior notice, making them unsuitable for user-defined SRSs.
💬

Error Message

The SRID range [%u, %u] has been reserved for system use. SRSs in this range may be added, modified or removed without warning during upgrade.
🔍

Known Causes

3 known causes
⚠️
Defining Custom SRIDs in Reserved Range
A user attempted to create or modify a Spatial Reference System (SRS) and explicitly assigned an SRID that falls within MySQL's designated system-reserved range.
⚠️
Importing Data with Conflicting SRIDs
Spatial data or schema was imported into MySQL where a Spatial Reference System (SRS) within the data uses an SRID that is reserved for MySQL's internal system.
⚠️
Lack of Awareness of Reserved Ranges
The user was unaware of the specific SRID ranges that MySQL reserves for its internal system use, leading to an unintentional conflict during spatial data management.
🛠️

Solutions

3 solutions available

1. Adjust SRID Range in Spatial Reference System Table medium

Manually adjust the SRID range in the mysql.srs table to avoid conflict with system-reserved ranges.

1
Connect to your MySQL server using a client tool (e.g., mysql command-line client, MySQL Workbench).
2
Switch to the `mysql` system database.
USE mysql;
3
Query the `srs` table to identify the conflicting SRID range and the SRIDs you are currently using.
SELECT * FROM srs WHERE sr.srid BETWEEN %u AND %u; -- Replace %u with the actual range from the error message
SELECT srid, srs_name FROM srs WHERE srid NOT IN (SELECT sr.srid FROM srs AS sr WHERE sr.srid BETWEEN %u AND %u); -- Identify your custom SRIDs
4
Determine a new, non-conflicting SRID for your spatial objects. A common practice is to use values above 1000 or a specific range reserved for user definitions if one is documented by your MySQL version.
5
Update the `srid` values of your spatial objects in your application tables to the new, non-conflicting SRID. This will likely involve a series of `UPDATE` statements.
UPDATE your_table SET your_geometry_column = ST_SetSRID(your_geometry_column, new_srid_value) WHERE ST_SRID(your_geometry_column) = conflicting_srid_value;
6
If you have custom entries in the `mysql.srs` table that are causing the conflict, you can either remove them (if no longer needed) or update their `srid` to a safe value. **Exercise extreme caution when modifying the `mysql.srs` table.**
DELETE FROM srs WHERE srid = conflicting_srid_value;
-- OR 
UPDATE srs SET srid = new_safe_srid WHERE srid = conflicting_srid_value;
7
Restart your MySQL server to ensure changes are fully applied.

2. Use Well-Known SRIDs easy

Prioritize using SRIDs that are standard and less likely to be reserved by the system.

1
Consult the MySQL documentation for your specific version to understand the SRID ranges reserved for system use. This information is crucial for selecting safe SRIDs.
2
When creating new spatial data or defining spatial columns, explicitly set the SRID to a well-known, non-conflicting value. For geographic coordinates (latitude/longitude), SRID 4326 (WGS 84) is standard.
CREATE TABLE your_table (
    id INT PRIMARY KEY,
    location GEOMETRY
);

-- When inserting data:
INSERT INTO your_table (id, location)
VALUES (1, ST_GeomFromText('POINT(10 20)', 4326));

-- Or when defining a column with a default SRID:
CREATE TABLE another_table (
    id INT PRIMARY KEY,
    location GEOMETRY SRID 4326
);
3
If you have existing spatial data with custom SRIDs that are causing the conflict, consider migrating them to a standard SRID if your application logic allows. This might involve creating a new column, copying data with `ST_Transform` if necessary, and then replacing the old column.

3. Upgrade MySQL Server medium

Update to a newer MySQL version where system SRID ranges might have been adjusted or documented.

1
Review the release notes for recent MySQL versions to see if there have been any changes or clarifications regarding reserved SRID ranges.
2
Plan and execute a MySQL server upgrade following the official MySQL upgrade documentation for your operating system and version.
3
After the upgrade, re-evaluate your spatial data and SRID usage. The upgrade might resolve the conflict automatically or provide clearer guidelines for SRID selection.
🔗

Related Errors

5 related errors