3

We are going to use mysql 5.5 in our application for production. I did some online search and it seems that mysql2 0.2.6 is the one for mysql5.5. Is this gem good for windows as well? Any tips on how to install and manage for production?

Thanks.

user938363
  • 9,990
  • 38
  • 137
  • 303

1 Answers1

1

The gems (either mysql or mysql2) provides an version-independent layer to the version of MySQL you are running.

However, if you're using a pre-compiled gem, it will require a version specific MySQL library be installed in your system.

To avoid that, you can use MySQL Connector/C which provides a version-independent way to connect to MySQL.

I've documented how to compile mysql gem against MySQL Connector/C in this blog post:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

mysql2 gem has some issues on Windows so I would recommend you use mysql gem for the time being.

Hope this helps.

Luis Lavena
  • 10,348
  • 1
  • 37
  • 39
  • Thanks for the notes. I will try it in my windows development environment. Do you mean the procedure in blog could be applied to any version of Mysql server in windows? Does the procedure apply to linux Ubauntbu server as well? – user938363 Oct 26 '11 at 17:45
  • You can skip the MySQL installation instructions if you want, MySQL Connector/C is independent of the version of MySQL you want to connect with. There is a connector-c for Linux and you can use that to install the gem on that system without the need to install MySQL itself (you connect remotely) – Luis Lavena Oct 26 '11 at 21:19