Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

MySQL->GaussDB

Updated on 2024-11-30 GMT+08:00

MySQL -> GaussDB B-, MySQL-, and PostgreSQL-Compatible Mode

Table 1 Data type mapping

Data Type (MySQL)

Data Type (GaussDB)

Whether to Support Mapping

CHAR

CHARACTER

Yes. If a column of this type in the source database contains characters that occupy more than one byte, increase the length of the column in the destination database.

VARCHAR

CHARACTER VARYING()

Yes. If a column of this type in the source database contains characters that occupy more than one byte, increase the length of the column in the destination database.

BINARY

BYTEA

Yes

VARBINARY

BYTEA

Yes

TINYBLOB

BYTEA

Yes

BLOB

BYTEA

Yes

MEDIUMBLOB

BYTEA

Yes

LONGBLOB

BYTEA

Yes

TINYTEXT

TEXT

Yes

TEXT

TEXT

Yes

MEDIUMTEXT

TEXT

Yes

LONGTEXT

CLOB

Yes

ENUM

VARCHAR

Yes

SET

VARCHAR

Yes

TINYINT

SMALLINT

Yes

SMALLINT

SMALLINT

Yes

MEDIUMINT

INT

Yes

INT

INT

Yes

BIGINT

BIGINT

Yes

FLOAT

REAL/DOUBLE PRECISION

Yes

DOUBLE

DOUBLE PRECISION

Yes

DATE

DATE

Yes

DATETIME

TIMESTAMP WITHOUT TIME ZONE

Yes

TIMESTAMP

TIMESTAMP WITH TIME ZONE

Yes

TIME

TIME WITHOUT TIME ZONE

Yes

BIT

BIT

Yes

JSON

JSON

Yes, but JSON containing BIT data is not supported.

DECIMAL

NUMERIC

Yes

NUMERIC

NUMERIC

Yes

YEAR

SMALLINT

Yes

BOOLEAN

SMALLINT

Yes

NOTE:
  • DATE values supported by MySQL range from '1000-01-01' to '9999-12-31'.

    DATETIME values supported by MySQL range from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

    TIMESTAMP values supported by MySQL range from '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.

    For details, see official MySQL documentation.

  • YEAR value ranges supported by MySQL are 1901 to 2155 and 0000. For details, see official MySQL documentation. GaussDB does not have the YEAR type, so DRS will convert the YEAR type of MySQL to the SMALLINT type.
  • For MySQL databases, '0000' of the DATE type will be converted to 0 by DRS.
  • If the data type of a column is INT and the column contains the AUTO_INCREMENT attribute, DRS converts the data type of the column to SERIAL during synchronization.
  • Auto-increment columns cannot be migrated in PostgreSQL compatibility mode.

MySQL -> GaussDB M-Compatible Mode

Table 2 Data type mapping

Data Type (MySQL)

Data Type (GaussDB)

Whether to Support Mapping

BOOL

BOOL

Yes

BOOLEAN

BOOLEAN

Yes

TINYINT

TINYINT

Yes

SMALLINT

SMALLINT

Yes

MEDIUMINT

MEDIUMINT

Yes

INT

INT

Yes

INTEGER

INTEGER

Yes

BIGINT

BIGINT

Yes

DECIMAL

DECIMAL

Yes

NUMERIC

DECIMAL

Yes

DEC

DEC

Yes

FIXED

DECIMAL

Yes

FLOAT

FLOAT

Yes

DOUBLE

DOUBLE

Yes

DOUBLE PRECISION

DOUBLE

Yes

REAL

DOUBLE

Yes

DATE

DATE

Yes

DATETIME

DATETIME

Yes

TIMESTAMP

TIMESTAMP

Yes

TIME

TIME

Yes

YEAR

YEAR

Yes

CHAR

CHAR

Yes

VARCHAR

VARCHAR

Yes

TINYTEXT

TINYTEXT

Yes

TEXT

TEXT

Yes

MEDIUMTEXT

MEDIUMTEXT

Yes

LONGTEXT

LONGTEXT

Yes

ENUM('value1','value2',...)

VARCHAR

Yes

SET('value1','value2',...)

VARCHAR+CHECK

Yes

BINARY

BINARY

Yes

VARBINARY

VARBINARY

Yes

TINYBLOB

TINYBLOB

Yes

BLOB

BLOB

Yes

MEDIUMBLOB

MEDIUMBLOB

Yes

LONGBLOB

LONGBLOB

Yes

BIT

BIT

Yes

JSON

TEXT

Yes

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback