How to Fix MySQL Error 3736 (ER_SRS_GEOGCS_INVALID_AXES)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mysql error 3736 when a geographic spatial reference system defines bad axis directions. Fix it by setting one axis to North or South and the other to East or West. MySQL uses spatial reference systems to map coordinates onto the Earth. Every geographic coordinate system needs two perpendicular directions to place points on a globe. When a custom map rule breaks this basic layout, the database stops the query. It returns symbol ER_SRS_GEOGCS_INVALID_AXES with SQLSTATE SR002 to protect y

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 3736 when a geographic spatial reference system defines bad axis directions. Fix it by setting one axis to North or South and the other to East or West.

MySQL uses spatial reference systems to map coordinates onto the Earth. Every geographic coordinate system needs two perpendicular directions to place points on a globe. When a custom map rule breaks this basic layout, the database stops the query. It returns symbol ER_SRS_GEOGCS_INVALID_AXES with SQLSTATE SR002 to protect your spatial data.

What causes mysql error 3736 in your database

This failure happens when a team creates or updates a geographic spatial reference system. The database parser reads the text string that defines the map rules. It checks the two axis definitions at the end of that text string. In a valid geographic setup, one axis must point North or South. The other axis must point East or West.

If both axes point North, the parser rejects the definition right away. If an axis uses a wrong label like Up or Down, the check fails. You will also see this error if the text swaps in flat grid labels. This often happens when engineers copy map strings from outside tools without checking the axes. Automated migration scripts can also trigger this bug if they build map text by hand.

How to find and fix the bad axis definition

Start by reading the full error message in your database log. The message shows the exact number of the broken spatial reference system. It also prints the two bad axis names that caused the failure. Locate the migration file or query that tried to save this map rule.

Read the axis section inside your spatial definition text string. Check the direction words attached to both the first and second axes. Change the text so one axis uses North or South for latitude. Change the other axis so it uses East or West for longitude. Make sure the order matches how your app sends coordinate pairs.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Do not give developers broad superuser rights in production to test this fix. Instead, run the updated spatial definition in a local test database first. Check that the database accepts the new text and plots test points in the right place.

How to prevent spatial reference errors in production

Standardize how your team adds new spatial rules to the database. Store all spatial definitions in version control alongside your regular schema changes. Have a second engineer check the axis directions before merging any map changes.

When possible, use the built-in spatial reference systems that ship with MySQL. The built-in catalog already includes thousands of tested map definitions with valid axes. Using an existing entry removes the risk of typing a bad axis direction. If you must add a custom system, copy the format from a working database entry. Keep production permissions tight so only vetted deployment pipelines can change system catalogs.

Add wire guardrails and masking beside MySQL

Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.

With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.

Frequently asked questions

What does SQLSTATE SR002 mean in MySQL?

SQLSTATE SR002 means a spatial reference system definition has an invalid format or rule. For error 3736, it points to bad geographic axis directions.

Can I use two East axes in a geographic system?

No, MySQL requires one latitude axis and one longitude axis for geographic systems. One must be North or South, and the other must be East or West.

Does this error harm existing spatial data in my tables?

No, the database blocks the bad definition before it saves any changes. Your existing tables and spatial indexes remain safe and untouched.

The query runs. The emails stay hidden.