Hi worldmagic thanks for you replies.
Apparently from mysql-4.0 onwards they have discontinued mysql_connect and are using mysql_real_connect unless some flags are set during configuration.
I finally ended up removing all the relevant mysql files form my system and then installing the rpms from my rh cd.
It was a pretty lame thing to do .. but I have a working mysql setup without any compilation errors for my c api ..