By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,332 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,332 IT Pros & Developers. It's quick & easy.

Mysql to Postgresql

P: n/a
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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Richard Huxton wrote:
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.


Um - 12th Feb? Where has this been lurking, and why has it emerged now?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.