Install informix on Mac OS X
For variable reasons, I installed the informix server on my Mac OS X(10.6.7) several times. But each time after installing it, I needed to figure out some wired things that prevent it running correctly, it's really annoying and time consuming. So I wrote this article to describe the key step to make the server working as expected.
- Download the informix develop edition 11.70 from http://www.ibm.com/developerworks/downloads/im/informix/ the download file is iif.11.70.FC1DE.macosx64.dmg for mac os x.
- Click ids_install.app to launch the GUI tool, folowing http://apps.topcoder.com/wiki/display/docs/TopCoder+Databases+Setup+Guide to install a 'informixoltp_tcp' database on port 'xxxxx'
-
Open terminal, login as user informix using command su - informix, add the following lines (assuming the informix is intalled to /Tools/informix) to ~/.bash_profile:
INFORMIXDIR=/Tools/informix INFORMIXSERVER=informixoltp_tcp ONCONFIG=onconfig.informixoltp_tcp INFORMIXSQLHOSTS=/Tools/informix/etc/sqlhosts.informixoltp_tcp PATH=${INFORMIXDIR}/bin:${INFORMIXDIR}/extend/krakatoa/jre/bin:${PATH} export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
- Excute . ~/.bash_profile to reload the bash profile, excute oninit -iv to initialize the informix database. You may probably get the shared memory not initialized error, to resovle the error, change FULL_DISK_INIT to 0 in $INFORMIXDIR/etc/onconfig.informixoltp_tcp, and then excute oninit -iv again, it will succeed.
- To verify the server state, excute onstat -, if IBM Informix Dynamic Server Version 11.70.FC1DE -- On-Line -- Up 00:45:53 -- 281744 Kbytes shows, then it successfully starts. (To shutdown the server, use onmode -ky, for normal starting, use oninit -v)
-
You can now use dbaccess to connect to the informix database, but when you use jdbc to connect, you will find the server refuses the connection, I am not sure whether or not it's a bug of the informix, you need to take the following step to make it working:
informixoltp_tcp onsoctcp 127.0.0.1 yourport
- Restart the server, everything works well now !