ruby-mysql icon indicating copy to clipboard operation
ruby-mysql copied to clipboard

MySQL server has gone away (Mysql::ClientError::ServerGoneError)

Open rbur004 opened this issue 2 years ago • 3 comments

I just upgraded from ruby 2.6 to 3.1.2 and from a mySQL 5 DB to MariaDB 10.6.7

I now get this ServerGoneError when I do a query. I was originally connecting via the loopback interface, but for MariaDB, have switched to using the socket.

As a test, I installed the mysql2 gem, and it works fine with the same code. The only downside is that mysql2 doesn't expose the table names, so if I do switch gems, I will need to rewrite multi-table queries and the code that handles them.

rbur004 avatar May 23 '22 00:05 rbur004

Should have added, this is a brand new server, running Ubuntu 22.04 and ruby-mysql (3.0.0)

rbur004 avatar May 23 '22 00:05 rbur004

I ran into this earlier today when I was trying to query on a connection created with Mysql.new, rather than Mysql.connect

xxx avatar Jul 14 '22 18:07 xxx

I ran into this earlier today when I was trying to query on a connection created with Mysql.new, rather than Mysql.connect

I received NoMethodError when using connect. Got Server gone away error when query with connection created with New method. Any suggestions? Thanks, My ruby version 2.7.6, mysqld version 8.0.31, ruby-mysql version 3.0.0.

szx0112 avatar Oct 11 '22 20:10 szx0112