简体   繁体   English

MySQL在ruby-2.2.2升级后没有连接到环境

[英]mysql not connecting to environment after ruby-2.2.2 upgade

I have just upgrade our legacy ruby app from ruby-1.9.3 to ruby-2.2.2. 我刚刚将旧的ruby应用程序从ruby-1.9.3升级到ruby-2.2.2。 The app runs fine locally, I have successfully deployed it to our staging environment but for some reason it is now having issues connecting to mysql. 该应用程序在本地运行良好,我已将其成功部署到我们的暂存环境中,但由于某种原因,它现在在连接mysql时遇到问题。

May 19 16:09:43 io-sbx-app-01-a3 rails[30750]: Reconnected to ActiveRecord
May 19 16:09:38 io-sbx-app-01-a3 rails[30738]: Verified ActiveRecord connections
May 19 16:09:43 io-sbx-app-01-a3 rails[30750]: Disconnected from ActiveRecord

Is there anything I need to consider with regards to connecting to mysql ? 关于连接到mysql,我需要考虑什么? We currently use the mysql2 adapter 我们目前使用mysql2适配器

Here's what i can think of, with the information i have 这是我能想到的,我所拥有的信息

1) see if the mysql service is up and running 1)查看mysql服务是否已启动并正在运行

2) see if the reconnect flag to true in database.yml. 2)查看database.yml中的reconnect标志是否为true。

3) in the staging environment, is the database service running in the same machine / on a different machine. 3)在登台环境中,是数据库服务在同一台机器上/另一台机器上运行。 If different machine, there might be some network related issues.. 如果是其他计算机,则可能存在一些与网络相关的问题。

4) during your deployment process, do you re-start the mysql service. 4)在您的部署过程中,您是否重新启动了mysql服务。 if not, it'd be good to try that.. 如果没有的话,那就试试吧。

5) you can check mysql.err and mysql.logs to see what happened from the database side of things.. 5)您可以检查mysql.err和mysql.logs以查看从数据库方面发生的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM