Upgrading MySQL to 5.6.10 on mac os and fixing mysql2 gem February 21, 2013

After updating MySQL to 5.6.10 in mac os with homebrew package manager you can notice that mysql2 gem will show such an error:

“Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10”

To fix it you can rebuild mysql2 with new mysql version config with the following command:


sudo ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/bin/mysql_config

Please also notice that your /usr/local/bin/mysql_config can have different location. So probably need to find where your mysql version is installed with find or which command.

 
4 Comments
Kiely March 12th, 2013

HI Alex,

I am getting following error on my 10.8.2 mac OS. I had trouble installing mysql 5.6, so I went for 5.5 version.

“MySQL client library version! This gem was compiled for 5.6.10 but the client library is 5.5.30”

Can you please suggest the fix for this.

thx,
Kiely

 
Alexander Kleshchevnikov March 12th, 2013

Kiely,

Did you try the following command?

sudo ARCHFLAGS=”-arch x86_64″ gem install mysql2 — –with-mysql-config=/usr/local/bin/mysql_config

 
Jared April 16th, 2013

Worked for me, though I didn’t need ARCHFLAGS. Thanks!

 
Jared April 16th, 2013

.. didn’t need sudo either :)

 
Leave a Reply