-
Notifications
You must be signed in to change notification settings - Fork 549
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
MySQL 8.1 and mysql2 gem version 0.5.5 - ArgumentError: negative string size (or size too big) #1333
Comments
Does this succeed if the server is MySQL 8.0? That would help narrow down if there is a recent change in MySQL 8.1 or if there is some other problem to solve in the Rails configs, specifically in your db migrations or db structure files. |
Hmm, ok it's here in Rails: As a workaround, try defining |
Hi, I tried both mysql files for connect to Mysql 8.1 on Debian 11 and it works. I found on stackoverflow that "ArgumentError: negative string size (or size too big)" should be raised because encoding did not match DB vs client (but issue was for Ruby on Rails 3). I found in Workbench that Mysql after create schema show utf8mb3 and utf8mb3_czech_ci but Ruby on Rails database.yml definition is utf8 , utf8_czech_ci. When i tried to change it in database yml to utf8mb3 then it fails on "Mysql2::Error: Unsupported charset: '"utf8mb3"'" |
The executable file Ok, that's really good debugging you found that this error message is a bit misleading! Try these:
or
|
I tried both before posting this issue:
Both connections end on same error: "ArgumentError: negative string size (or size too big)" I remember when install Mysql 8.1 i chose "compatible connection" which allow connect old mysql clients to Mysql 8.1 (i dont remember the exact name of the setting). I think it works, because mysql 5.7 binary client should connect and operate and mysql 8.0 client too. |
I think that setting actually refers to very old MySQL protocols. MySQL 5.7 and 8.0 speak the same. |
when run:
or
will generate error in abstract_mysql_adapter.rb:760:in configure_connection:
Here is database.yml:
Important information to understand the configuration in yml file: Connect to Mysql is established via ssh tunnel to Debian 11 Server.
Here is full error:
The text was updated successfully, but these errors were encountered: