Mysql to Postgresql

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Prashanthi Muthyala" <pmuthyal(at)spsu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Mysql to Postgresql
Date: 2004-02-12 21:09:18
Message-ID: 200402122109.18152.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 12 February 2004 20:25, Prashanthi Muthyala wrote:
> Hi Richard

Hi Prashanthi - nice to hear from you again. I've taken the liberty of cc-ing
the general list on this, since there may be others who can help here.

> I am trying to migrate the database and its tables from mysql in my
> windows machine to postgresql in my new red hat linux . I was following
> your links which has converstions from msaccess,mysql to postgresql and in
> the process I have downloaded pgadmin 11 and i got the wizard. It says to
> connect to target server. now what is that I need to write in that target
> server?
>
> the field in the connect wizard are
> 1. server
> 2.port
> 3.username
> 4.password
>
>
> I have mysql control center in which I have some databases which I want to
> transfer to postgresql .
>
> is this pgadmin2 wizard will connect to the mysql server? what port number
> should I give and I have some usernames and passwords in the mysql
> database. shall I type those username and password.

Good question - I can't say, since I don't have pgadmin2 here. However, I do
know that PostgreSQL listens on port 5432 and MySQL on 3306.
Tip 1: On a linux box, look in the /etc/services file, that lists what port
most programs run on
Tip 2: "lsof -i" will show you what ports are in use and by what program.

I'd say try the mysql port/username/password and if that doesn't work, try the
postgresql ones.

> Kindly let me know I actually thought of installing postgresql in windows
> also and once I get the tables migrated from mysql to postgresql in the
> same machine.. then I will burn it to cd and then thought of copying them
> to postgresql present in red hat linux which is in different machine.

A linux box will read a CD burnt on a Windows machine just fine. Dump the
mysql database on the Windows PC and copy the files off.

> actually both these machines are connected to the same LAN. but I dont
> know if there exists any way to direct dump the mysql tables in windows
> machine to postgresql in linux machine..

if the pgadmin wizard doesn't work, I would probably do something like:
1. On the windows machine use "mysqldump -T ..." to dump the database to a set
of .sql and .txt files
2. Fix the .sql files so you can recreate the tables in PG, and create the
tables either using psql or cutting and pasting into pgadmin
3. Use the COPY command to import the tab-separated text files, or do it with
pgadmin.

Note that if you copy the .txt files over to the linux box, you'll want to use
the dos2unix command to change the line-endings first. If that program isn't
installed on your linux box, then you'll probably find it on
http://www.rpmfind.net/

--
Richard Huxton
Archonet Ltd

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Tesser 2004-02-12 21:40:28 Re: help with query speed
Previous Message Dann Corbit 2004-02-12 20:51:17 Re: help with query speed