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

mysql2 bug when using win 11 #1388

Open
tareilly opened this issue Dec 29, 2024 · 1 comment
Open

mysql2 bug when using win 11 #1388

tareilly opened this issue Dec 29, 2024 · 1 comment

Comments

@tareilly
Copy link

Problem with Ruby gem mysql2 with windows ll
libmysql.dll in \ruby\bin
mysql client c (8.0.40)
mysql2 version (0.5.6)
ruby version 3.3.6 (2024-11-05 revision 75015d4c1f) [x64-mingw-ucrt]

Single line ruby program:
require 'mysql2'

Fault:
internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:136:in `require': Incorrect MySQL client library version! This gem was compiled for 10.8.8 but the client library is 3.4.1. (RuntimeError)

Program crashes. Mysql client is 8.0. not 10.8.8, client library is 8.0.4 not 3.4.1

From lines ~ 1545 - 1550 in mysql2-0.5.6\mysq2\ext\client.c
if (lib[i] != MYSQL_LINK_VERSION[i]) {
rb_raise(rb_eRuntimeError, "Incorrect MySQL client library version! This gem was compiled for %s but the client library is %s.", MYSQL_LINK_VERSION, lib);
}

lib[i] and MYSQL_LINK_VERSION are miscomputed. The gem appears to have a bug when run on Win 11.
I commented this section and the gem now works fine on Win 11 after altering client.c and rebuilding and reinstalling the gem. I had no problem with Win 10
I don't know enough about MYSQL linkages to fix it.

@sodabrew
Copy link
Collaborator

Check out #1348 -- is it possible that you have also installed MariaDB on your system?

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

2 participants