OSX(Yosemite)上的rails + MySQL

I was running an old rails project on ruby-1.9.3-p125 until i updated mysql. I ended up removing & reinstalling mysql via homebrew in order to fix issues. I managed to recover the enviroments of all my php projects but not this one.

running ps aux | grep mysql returns:

myuser           19131   0,0  0,1  3570856   6428   ??  S     1:30μμ   0:11.46 /usr/local/Cellar/mysql/5.7.11/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.7.11/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/Macbook.local.err --pid-file=/usr/local/var/mysql/Macbook.local.pid
myuser           19039   0,0  0,0  2447704    480   ??  S     1:30μμ   0:00.02 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql
myuser           27974   0,0  0,0  2423356    208 s001  R+    1:22μμ   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql

When i try to run rake db:create i get the following error:

rake aborted!
uninitialized constant Mysql2::Client::SECURE_CONNECTION

mysql.server status seems to be running.. when i try to stop (mysql.server stop) i get:

Shutting down MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/macbook.local.pid).

And mysql continue to run but with a new pid id .

Any idea whats wrong with the rails project and how to approach it?

Thanks, C

You need to update your mysql2 gem.

First of all, check your Gemfile includes gem 'mysql2' and not the older mysql gem

Next, run bundle update mysql2 if you didn't need to change your gemfile, or bundle install if you did. Only run bundle update (without the mysql2 part) if you're sure updating the other gems wont affect anything.

Then try running your rake command.