Aman Agrawal
Aman Agrawal

Reputation: 93

How to migrate data from an Informix database to MySQL

We have to migrate data from an Informix database to a MySQL database.

Help me how we can achieve it?

What steps or commands I have to use it? If you have any document or reference link that would be very much helpful.

Upvotes: 1

Views: 1547

Answers (1)

Aman Agrawal
Aman Agrawal

Reputation: 93

Step1: login to Informix and run the unload command. It will create a backup file named "file1" at current location under export directory.

UNLOAD to 'export/file1' SELECT * FROM db1.table1

Step2: Create table1 in MySQL Database.

Step3: Login to MySQL Database and set the global variable.

mysql> SET GLOBAL local_infile=1;
mysql> quit

Step4: Login to MySQL Database using below command

mysql --local-infile=1 -u root -p

Step5: Load the data into MySQL Databse using LOAD DATA command

LOAD DATA LOCAL INFILE '/export/file1'
INTO TABLE table1
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n';

Upvotes: 1

Related Questions