SwapSQL

PostgreSQL → MySQL

Convert PostgreSQL inet and network types to MySQL

PostgreSQL's network types (inet, cidr, macaddr) validate and sort IPs natively. MySQL stores them as text; validation moves to the application or CHECK constraints.

inet / cidr / macaddr VARCHAR

What to know

Before / after

PostgreSQL

ip inet
-- WHERE ip << '10.0.0.0/8'

MySQL

ip VARCHAR(64)
-- WHERE INET_ATON(ip) BETWEEN INET_ATON('10.0.0.0')
--                        AND INET_ATON('10.255.255.255')

Don't convert column-by-column — convert the whole database.

Upload a dump, get back ready-to-import SQL with this mapping (and every other one) applied.

Open the PostgreSQL → MySQL converter

See the full type mapping table or all guides.