Local rails on Mac OSX lose connection with mysql

Sometimes my local Rails application loses touch with MySQL. I get some error that the connection failed, but if I just refresh the page, it works fine. This never happened in my STAGE or PROD environment (I use Ubuntu), so this was not a big deal.
Does this happen to someone else? Is there something I can do to fix this? Is it MySQL or Ruby?

+3
source share
2 answers

I remember that this problem was a bit back (before I upgraded to Leopard?). They are difficult to diagnose, but look at the log files and try to set "wait_timeout" longer (you do not need to mess with "max_connections". See:

http://www.mysqlperformanceblog.com/2008/08/23/how-to-track-down-the-source-of-aborted_connects/

http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html

http://www.softwareprojects.com/resources/programming/t-how-to-fix-mysql-database-myisam-innodb-1634.html

I think I followed Dan Benjamin MySql so as not to cause problems:

http://hivelogic.com/articles/installing-mysql-on-mac-os-x/

+1
source

It seems like the best solution for this is to install the platform-specific mysql driver.
sudo gem install mysql

+3
source

Source: https://habr.com/ru/post/1698206/


All Articles