wkhatch wkhatch - 2 months ago 5x
MySQL Question

Installing ruby mysql gem with percona server

New install of cent os 5.4; clean install of percona xtradb server (Server version: 5.1.56-rel12.7 Percona Server (GPL), 12.7, Revision 224) gem install mysql failed with the output

/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***

which appears to indicate it can't find the dev libraries. I know I'd normally use the additional options -- --with-mysql-lib=... but I don't believe they're installed as part of the normal percona install outlined here: percona repositories info

So I tried doing yum install mysql-devel but get a conflict with the percona stuff. I found this post where the proposed solution was using the --with-mysql-config option. Percona doesn't automatically install a my.cnf at /etc/my.cnf upon installation, so I whipped one up and placed it there because that's where the init.d script for mysql checks for it. Restarted mysql, confirmed that it's now loading that configuration and attempted the install again, but still failed with

"Exec format error - /etc/my.cnf --cflags (Errno::ENOEXEC)"

Thanks for any help

I also did a find / -name mysql.h and nothing, so it looks like the required libraries are not present after installing both percona server and client with yum


If you correctly added Percona yum repository you just need to install the Percona-Server-devel package:

yum install Percona-Server-devel-55

Replace 55 with the Percona Server version you're currently using.

After that, mysql gems will install correctly.