Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while connecting MariaDB v10.0.10 #506

Closed
cbajohr opened this issue Apr 8, 2014 · 11 comments
Closed

Error while connecting MariaDB v10.0.10 #506

cbajohr opened this issue Apr 8, 2014 · 11 comments

Comments

@cbajohr
Copy link

cbajohr commented Apr 8, 2014

The mysql2 gem is currently not working with the newest MariaDB Version 10.0.10

Exception:

/usr/local/rvm/gems/ruby-2.1.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:in require': Incorrect MySQL client library version! This gem was compiled for 5.5.34-MariaDB but the client library is 10.0.10-MariaDB. (RuntimeError) from /usr/local/rvm/gems/ruby-2.1.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in require' from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in each' from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:inblock in require'
from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in each' from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:inrequire'
from /usr/local/rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler.rb:131:in require' from /Users/christophbajohr/Work/www/kita-rabennest/config/application.rb:7:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in require' from /usr/local/rvm/gems/ruby-2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:inblock in <top (required)>'
from /usr/local/rvm/gems/ruby-2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in tap' from /usr/local/rvm/gems/ruby-2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in<top (required)>'
from bin/rails:4:in require' from bin/rails:4:in

'

@simi
Copy link
Contributor

simi commented Apr 8, 2014

You need to compile mysql2 against MariaDB 10.0.10 if you want to use it with that version.
https://github.com/brianmario/mysql2#configuration-options

You can see on CI, that 10.0.10 is supported.
https://travis-ci.org/brianmario/mysql2/jobs/22505303

@cbajohr cbajohr closed this as completed Apr 8, 2014
@cbajohr
Copy link
Author

cbajohr commented Apr 8, 2014

Thanks for the hint

@ibizaman
Copy link

ibizaman commented Sep 2, 2014

How do you compile mysql2 with MariaDB 10.0.10 ? I did:

$ rvm use 2.1.1@redmine
$ /usr/bin/mysql_config --version
10.0.13
$ sudo gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config
$ sudo systemctl restart nginx

But no luck.

@sodabrew
Copy link
Collaborator

sodabrew commented Sep 2, 2014

What was the output from this step:

$ sudo gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config

@ibizaman
Copy link

ibizaman commented Sep 2, 2014

$ sudo gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config
Building native extensions with: '--with-mysql-config=/usr/bin/mysql_config'
This could take a while...
Successfully installed mysql2-0.3.16
Parsing documentation for mysql2-0.3.16
Done installing documentation for mysql2 after 1 seconds
1 gem installed

@sodabrew
Copy link
Collaborator

sodabrew commented Sep 2, 2014

Looks like it worked then. What seems to be the problem?

@ibizaman
Copy link

ibizaman commented Sep 2, 2014

Well that's what I would say also, but after restarting nginx and accessing the web page, I still have this error in the log output:

Incorrect MySQL client library version! This gem was compiled for 5.5.37-MariaDB but the client library is 10.0.13-MariaDB. (RuntimeError)

That being said, I tried removing the gem with gem uninstall mysql2 and after restarting nginx it still gives me the error. So this means I have it somewhere else... I'll take a look then. Sorry to have bothered you with this for nothing. :) I'll definitely report when this is sorted out.

@sodabrew
Copy link
Collaborator

sodabrew commented Sep 2, 2014

Aha, you must make sure that you don't have mismatched libraries on your system.

@rahul286
Copy link

rahul286 commented Apr 9, 2015

I had same problem.

Following worked for me:

gem uninstall mysql2
bundle config build.mysql2 --with-mysql-config=/usr/bin/mysql_config
bundle install

@blevonius
Copy link

@rahul286 that fixed it for me, except mysql-config path for me was /usr/local/bin/mysql_config Thanks!

@HectorOrdonez
Copy link

The following worked for me:

sudo apt-get install libmariadbd-dev -y
bundle install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants