Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a proper solution for anyone interested, that doesn't mess up your current installation of mysql server - </p> <p><strong>EDIT : Make sure you download the right version on MySQL server. :</strong> </p> <p>if you intend to connect to a 6.0 or 5.5 server - download those binaries. I'm connecting to mysql 5.1 - hence my example. Also keep in mind latest mysql2 gem ( v 0.3.7) was tested against mysql server 6 - hence it keeps failing to build on windows for earlier versions. also make sure you use the right libmysql.dll in your ruby folder. </p> <ol> <li>Download a zip file with mysql server 5.1 NOT the msi one. Make sure it's 32-bit NOT 64-bit. (<a href="http://dev.mysql.com/downloads/mysql/5.1.html" rel="noreferrer">From here</a>)</li> <li>Since there is no installer file with this, create a folder c:\mysql-gem-install - you can remove it once you finish.</li> <li>Extract all the files from the zip file into the folder you just created.</li> <li><p>now run this command</p> <pre><code>gem install mysql2 -- '--with-mysql-lib="c:\mysql-gem-install\lib\opt" --with-mysql-include="c:\mysql-gem-install\include"' </code></pre></li> </ol> <p>I just installed mysql2 gem v. 0.3.7</p> <p><strong>EDIT 1</strong> One more thing: make sure you run the command in Command Prompt directly. As in not PowerShell or Consol2 - for some reason if you try that it will give you and error " invalid option" - has to do with the way -- is parsed.</p> <p><strong>EDIT 2</strong> I just was doing a blank windows 7 install and one thing I ran into is that you need to add one more step to this: check to see if there is libmysql.dll in your ruby bin directory, if not copy one over from your mysql install. It should be of the same version as your mysql2 build.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload