Installing MySQL on Microsoft Windows: A Simple Guide

Having MySQL installed on your personal computer is helpful when wanting to work offline or when wanting to test table configuration and procedures without affecting others’ work. The process is fairly straightforward, but the official documentation on the MySQL website certainly doesn’t give that effect. It’s a labyrinth of hyperlinks, Google searches for missing components, and unanswered questions regarding what to click and when to click it.

Therefore, I thought I’d try to compile most of the necessary downloadable components along with step-by-step information in one place so that others may install it quickly and easily.

  1. Go here and download “Windows (x86, 32-bit), MSI Installer” (mysql-installer-community-5.6.23.0.msi). You will need to log in or create an account with Oracle.
  2. Once the file is fully downloaded, launch the installation wizard by double-clicking the downloaded file.
  3. Once the wizard launches, click the “Add” button in the top right corner and accept the license agreement.
  4. On the screen labeled “Select Products and Features” download the products and features that you might need. These are the ones I elected to download:
    1. MySQL Server 5.6.23 – X86: MySql Servers > MySQL Server > MySQL Server 5.6
    2. MySQL For Excel 1.3.3 – X86: Applications > MySQL For Excel > MySQL for Excel 1.3
    3. Connector/Python (2.7) 2.0.3 – X86: MySQL Connectors > Connector/Python > Connector/Python 2.0 for Python 2.7
    4. MySQL Documentation 5.6.23 – X86: Documentation > MySQL Documentation > MySQL Documentation 5.6
    5. Samples and Examples 5.6.23 – X86: Documentation > Samples and Examples > Samples and Examples 5.6
    6. Products and Features

    Note: Feel free to download anything else you might feel is necessary to your operations or even pass on some of the bonuses I opted to download. MySQL Server is necessary — that’s the main component you want to download. Everything else is optional. I opted for Python connectors and Excel plugins since I definitely rely on Python connectivity for a lot of my projects and thought that Excel might be useful in the future. Documentation and Examples are recommended in case you might ever get into trouble, but are not required. Review the menus and options available and determine what bonuses you might prefer.

  5. On the Installation screen, click “Execute”. This will start the installation of all components selected on the previous screen.
  6. Once all components have finished downloading, click the Next button and begin the configuration of your MySQL server.
    1. Most items on the Types and Networking page can be left as is. I didn’t touch any of the default settings.
      Types and Networking
    2. Set up your root user password and configure any other users. When setting my user, since I’m just planning to work on my local server I selected the localhost server option.
      User Configuration
    3. The next page is for configuring MySQL as a Windows Service. These are pretty standard and what enables your computer to run as a MySQL server. You can access Windows services by opening services.msc via Run… Here’s a breakdown of what each of these settings mean (I kept all mine as is):
      1. Configure MySQL Server as a Windows Service: If you are not planning to run MySQL for your local server, then it may be worth it to skip this. This option is most likely required if you plan to use your computer as a localhost. I’m not sure if MySQL has an option to run the service interactively (which would be the alternative to a Windows service).
      2. Windows Service Name: The name of the service as it will be in services.msc.
      3. Start the MySQL server at System Startup: As the name suggests, this will configure the service to startup at boot. If you don’t plan to use MySQL regularly or have limited processing capacity, you may want to uncheck this and turn the service on manually when you want to utilize localhost capabilities.
      4. Run Windows Service as…: This is for permissions configuration. If you don’t want the Windows service to have full system accessibility, you may elect to set up a custom user with limited permissions.
    4. Click “Execute” on the next screen to configure your application.
    5. Click “Finish”.
  7. If you elected to install Samples and Examples, you will be taken back to the Product Configuration screen. You will be required to configure this component, as well, prior to completing installation. Click “Next” to begin this configuration.
    1. On the Connect to Server page, “Check” the root user in order to be able to click the “Next” button.
    2. “Execute” configuration.
  8. “Finish” your installation. Copy the installation log, if you so desire.

And that’s it! Use your preferred MySQL Management Tool (I like HeidiSQL) to connect to your local server and start working.

You might not be able to download certain components without downloading other related applications. Here are some of the common applications required prior to installing MySQL on my computer:

Pentaho Kettle MySQL Connection Errors

It’s been a minute.

I’ve been working on a number of personal projects recently and have not taken the time to document my development. I’ve learned a ton about everything from JavaScript, to ETL software Pentaho Kettle, to MySQL and Python and feel like now might be a good time to recap some of the issues I ran into during my development and also the solutions I found/devised as workarounds. More than anything, I hope this helps others that run into similar issues (and possibly also help me if by accident I run into these issues again).

The first issue I would like to recount is trouble in connecting to my GoDaddy MySQL server via Pentaho Kettle. For the longest time, this was an absolute struggle for me with no seeming explanation in site. I had set up my MySQL server on my hosting service, GoDaddy, without any issue and had been able to connect successfully via HeidiSQL. However, when I was attempting to set up my MySQL connection in Pentaho Kettle, I kept getting this absolutely horrendous error message:


Error connecting to database [devdb2] : org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database

Exception while loading class
org.gjt.mm.mysql.Driver


org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database

Exception while loading class
org.gjt.mm.mysql.Driver


    at org.pentaho.di.core.database.Database.normalConnect(Database.java:368)
    at org.pentaho.di.core.database.Database.connect(Database.java:317)
    at org.pentaho.di.core.database.Database.connect(Database.java:279)
    at org.pentaho.di.core.database.Database.connect(Database.java:269)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:86)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464)
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123)
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26)
    at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:119)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:378)
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:304)
    at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:115)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:62)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:493)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:478)
    at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:7770)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123)
    at org.pentaho.ui.xul.swt.tags.SwtMenuitem.access$100(SwtMenuitem.java:27)
    at org.pentaho.ui.xul.swt.tags.SwtMenuitem$1.widgetSelected(SwtMenuitem.java:77)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1183)
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6966)
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:567)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
Exception while loading class
org.gjt.mm.mysql.Driver

    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:423)
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:352)
    ... 50 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:414)
    ... 51 more

I still shudder looking at this.

Fortunately, the solution to this problem is not a complicated one. I found the answer on this post from StackOverflow. The reason the connection is failing is due to a missing MySQL Java connector library in Pentaho Kettle. This is how I solved the issue on my computer:

  1. I downloaded the most recent version of the MySQL Java Connector. (I needed to create an Oracle MySQL account in order to download this driver. To get the .zip format, I selected the Platform Independent option from the drop-down menu.)
  2. Extract the files from the downloaded .zip file and find the one labeled mysql-connector-java-5.1.34-bin.jar.
  3. Place this file into your Pentaho Kettle lib folder. The address for that should be something like C:\Program Files\pentaho\kettle\data-integration\lib.
  4. Restart Pentaho Kettle.

Create a free website or blog at WordPress.com.