Skip to content

Incorrect MySQL client library version! This gem was compiled for 10.8.8 but the client library is 3.4.3. (Ruby on Rails - MySQL) #1391

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

Open
PAWANRAJ-CSE opened this issue Feb 6, 2025 · 4 comments

Comments

@PAWANRAJ-CSE
Copy link

Hi all!

Check this info:

ruby -v
ruby 3.3.7 (2025-01-15 revision be31f993d7) [x64-mingw-ucrt]

rails -v
Rails 8.0.1

bundle info mysql2

mysql2 (0.5.6)
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
Homepage: https://github.com/brianmario/mysql2
Documentation: https://www.rubydoc.info/gems/mysql2/0.5.6
Source Code: https://github.com/brianmario/mysql2/tree/0.5.6
Changelog: https://github.com/brianmario/mysql2/releases/tag/0.5.6
Bug Tracker: https://github.com/brianmario/mysql2/issues
Path: C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mysql2-0.5.6
mysql -V
mysql Ver 8.0.40 for Win64 on x86_64 (MySQL Community Server - GPL)

The error is as follows:

Caused by:
Incorrect MySQL client library version! This gem was compiled for 10.8.8 but the client library is 3.4.3.
internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:37:in require' internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb:37:in require'
F:/CSE/ROR-2024/PROJECTS/ONE/thirdapp/config/application.rb:7:in

' F:/CSE/ROR-2024/PROJECTS/ONE/thirdapp/Rakefile:4:in require_relative'
F:/CSE/ROR-2024/PROJECTS/ONE/thirdapp/Rakefile:4:in ' bin/rails:4:in

'
(See full trace by running task with --trace)
How to resolve the issue?? Kindly help

@PAWANRAJ-CSE PAWANRAJ-CSE changed the title Incorrect MySQL client library version! This gem was compiled for 10.8.8 but the client library is 3.4.3. Incorrect MySQL client library version! This gem was compiled for 10.8.8 but the client library is 3.4.3. (Ruby on Rails - MySQL) Feb 6, 2025
@msg7086
Copy link

msg7086 commented Feb 20, 2025

Edit C:\Ruby33-x64\msys64\ucrt64\include\mysql\mariadb_version.h change to #define MARIADB_CLIENT_VERSION_STR "3.4.3"

@FenleyHalebourne
Copy link

Referring to #1348 (comment) and #1210 (comment), you can try the following steps:

Uninstall mysql2: gem uninstall mysql2
Clone the mysql2 repository: git clone https://github.com/brianmario/mysql2.git
Enter the mysql2 directory: cd mysql2
Switch to tag v0.5.6: git checkout 0.5.6
Edit the client.c file: notepad ext\mysql2\client.c #(and comment out line 1541-1543)
Return to the mysql2 directory: cd ..\..
Edit the mysql2 version information: notepad lib\mysql2\version.rb #(and change the version to 0.5.6.1)
Build the gem: gem build mysql2.gemspec
Copy the resulting mysql2-0.5.6.1.gem file to your project folder
Delete the Gemfile.lock file
Modify the Gemfile to change the mysql2 version: gem "mysql2", "~> 0.5.6.1"
Execute bundle.bat in your project
Verify that the version information is 0.5.6.1 by running the command: gem info mysql2

@BenyLaLa
Copy link

BenyLaLa commented Apr 7, 2025

Edit C:\Ruby33-x64\msys64\ucrt64\include\mysql\mariadb_version.h change to #define MARIADB_CLIENT_VERSION_STR "3.4.3"

Uninstall mysql2: gem uninstall mysql2
Reinstall mysql2: bundle install

@aunghtain
Copy link

any update on this? having the same issue.

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

5 participants