Navigating MySQL Installation Woes for Ruby on Rails Applications on Windows

Working through the development of my Ruby on Rails application, what should have been a straightforward task turned into a challenge when I encountered test database locking issues on SQLite. It was evident that a transition to MySQL was necessary, sooner than expected. I initially followed a tutorial that provided valuable information but encountered unexpected hurdles during the process.

Here are the steps that finally worked for me after a series of trial and errors:

  1. Install MySQL: Begin by installing MySQL, a process well-documented in various tutorials available online. Once installed, move on to the next steps.
  2. Download MySQL Web Community 8.0.3 Installer: Download the MySQL Web Community 8.0.3 installer and include the MySQL Connector/C++ 8.0 within this tool. For a 64-bit machine, install version 8.0.33 – X86.
  3. Command Line Execution: Open the command prompt (cmd) and navigate to your Ruby folder. For example, if it’s in “C:\Program Files\MySQL\Connector C++ 8.0”, run the following command

Ensure you adjust the path accordingly. This step is crucial for successful installation.

  1. Verification: After executing the command, you should see the message “1 gem installed.” This indicates that the MySQL2 gem has been successfully installed.
  2. Testing the Application: Test your Ruby on Rails application using MySQL.

Errors I encountered:
After testing the application, following the tutorial, using the 6.1.11 version, I was receiving the following error when trying to use MySQL. 

By following these steps, I overcame the challenges in transitioning to MySQL for my Ruby on Rails application on Windows. Feel free to refer to the provided tutorial for additional insights.

Leave a comment