I’m in the middle of moving OpenMRS’s web presence from a shared virtual machine to a new dedicated box.  The only trouble I ran into was with the mysql python module (again).

For posterity’s sake, I’m going to write my solution here.

easy_install mysql-python

I received this error when trying to install the MySQLdb-python module into python on centOS:

_mysql.c:2808: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:2886: error: expected ‘{’ at end of input
error: Setup script exited with error: command ‘gcc’ failed with exit status 1

The fix I remembered.  I just had to install the python development packages:

yum install python-devel

I then had another very odd and strangely familiar error:

In file included from _mysql.c:35:
/usr/include/mysql/my_config.h:15:28: error: my_config_i386.h: No such file or directory
error: command ‘gcc’ failed with exit status 1

Googling around gave me nothing helpful…in fact the results looked strangely familiar as well.  I couldn’t remember the solution to this one though.

Eventually, I actually read the error message and realized that our new vm isn’t an x64 box.  For some reason there was a my_config_x64.h file in /usr/include/mysql but there wasn’t a my_config_i386.h.  Luckily, that file was present on the old server. Copying that file from /usr/include/mysql on the old box to the new was the cure.

Commenters have pointed out that sometimes “mysql-devel” needs to be installed as well

This is in the babble category tagged as , , ,


I recently had the pleasure of setting up an ant build of OpenMRS on our new servers. After installing ant and the OpenMRS source code I kept getting a never-before-seen error when building:

No supported regular expression matcher found

I made sure I had jdk 1.6 installed. I tried upgrading to Ant 1.7 (from 1.6.5).

I ran an “ant -diagnostics”. It wasn’t showing the optional ant jars so I dropped all of the jars into the ant home lib directory. Now the jars were showing up but I was still getting the same error as before.

The solution ended up being that Ant lied to me. It was actually looking for the jars in /usr/share/java/ant (not in its reported /usr/share/ant). The puzzling thing is that Ant tells me it finds the jars when running “ant -diagnostics”.

I ended up installing the optional ant jars via yum. (or apt-get if you’re on a debian flavor) Yum didn’t have the explicit ant-optional package, so I just installed all ant-*.jar files. Voila! Successful building via ant is now possible.

This is in the openmrs category tagged as , ,

1 comment »