SwapSQL

PostgreSQL → MySQL

Convert PostgreSQL uuid to MySQL

MySQL has no uuid column type, so UUIDs are stored in their canonical 36-character text form. Defaults like gen_random_uuid() get a MySQL equivalent.

uuid CHAR(36)

What to know

Before / after

PostgreSQL

CREATE TABLE accounts (
  uid uuid DEFAULT gen_random_uuid() NOT NULL
);

MySQL

CREATE TABLE accounts (
  uid CHAR(36) NOT NULL DEFAULT (uuid())
);

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.