From:       To:      
Home > Documentation > DB2 to MySQL

IBM DB2 to MySQL Types Mapping

[DB2 to Postgres Converter]  [Troubleshooting]

IBM DB2 and MySQL data types are not matched directly. Most of them are equal while others are not. When migrating database from DB2 to MySQL it is important to take care about safe types mapping according to the table below:

IBM DB2 MySQL
BIGINT BIGINT
BINARY(n) BINARY(n)
BLOB LONGBLOB
CHAR(n), CHARACTER(n) CHAR(n)
CLOB(n) LONGTEXT
DATE DATE
DBCLOB(n) LONGTEXT
DECFLOAT(16 | 34) FLOAT
DECIMAL(p,s) DECIMAL(p,s)
DOUBLE DOUBLE
FLOAT(p) DOUBLE
GRAPHIC(n) CHAR(n)
INTEGER INTEGER
NUMERIC(p,s) NUMERIC(p,s)
NCHAR(n) CHAR(n
NCHAR VARYING(n), NVARCHAR(n) VARCHAR(n
NVARCHAR(n) VARCHAR(n)
REAL REAL
SMALLINT SMALLINT
TIME TIME
TIMESTAMP TIMESTAMP
VARBINARY(n) VARBINARY(n)
VARCHAR(n) VARCHAR(n)
VARGRAPHIC(n) VARCHAR(n)