Common SQL Errors

MySQL Error 3195 ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO - How to Fix and Prevent

Galaxy Team
August 8, 2025

MySQL raises warning 3195 when GEOMFROMWKB() is used to force SRID 0; the call is deprecated and will be replaced by ST_SRID().

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 3195 ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO?

ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO warns that GEOMFROMWKB(geom,0) is deprecated. Replace the call with ST_SRID(ST_AsWKB(geom),0) or store the geometry with a valid SRID to clear the warning.

Error Highlights

Typical Error Message

ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO

Error Type

Deprecation Warning

Language

MySQL

Symbol

st_srid(geometry, 0) in a future version. Use %s(st_aswkb(geometry), 0) instead. ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO was added in 5.7.19.

Error Code

3195

SQL State

1000

Explanation

Table of Contents

What does ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO mean?

Warning 3195 appears when a query calls GEOMFROMWKB() with an SRID value of 0. MySQL flags this as deprecated behaviour because future versions will handle SRID assignment with ST_SRID().

When does the warning appear?

The server emits the warning during INSERT, UPDATE, or SELECT statements that attempt to coerce a geometry column to SRID 0 through GEOMFROMWKB(). It is first seen in MySQL 5.7.19 and persists in 8.x.

Why should you care?

Although flagged as a warning, ignoring it can break forward-compatibility. Queries relying on the deprecated call may fail or return different results after an upgrade.

Quick remediation overview

Replace GEOMFROMWKB(geom,0) with ST_SRID(ST_AsWKB(geom),0) or, better, store the geometry with its proper SRID and avoid forcing 0 altogether.

Common Causes

Deprecated function call

GEOMFROMWKB() was never intended for SRID manipulation. Using it with a second argument of 0 triggers the warning.

Legacy migration scripts

Old ETL jobs that zero-out SRID values to sidestep coordinate reference checks will surface the warning after 5.7.19.

Copy-paste from outdated tutorials

Older code examples published before the deprecation still circulate online, leading teams to replicate the pattern.

Related Errors

ER_WARN_DEPRECATED_FUNCTION

General notice that a called function is deprecated; replace with the recommended alternative.

ER_SRS_NOT_FOUND

Raised when MySQL cannot locate the specified SRID in the spatial reference system tables.

ER_WARN_DEPRECATED_SYNTAX

Alerts you that a particular SQL syntax element will be removed in future releases.

FAQs

Does this warning stop my query?

No. It is a warning, so the statement completes but is logged in the warning list.

Will the call be removed in MySQL 9?

MySQL documentation indicates the old signature will be dropped in a future major release, likely 9.0.

Is SRID 0 ever valid?

SRID 0 is reserved for unspecified or Cartesian data. Most production datasets should store a real spatial reference like 4326.

How does Galaxy help?

Galaxy surfaces MySQL warnings inline and offers AI-generated fixes, letting you refactor the query without leaving 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