Installing MySQL for Testing – Part 1

Pin It
Share on Tumblr

At long last…  the first real post of the intro series on getting started with MySQL!  (Better late than never, right?)

There are a few ways you can go about setting up a test instance that are generally shared across Operating Systems:

  • Install locally on your machine (Windows, OSX, Linux)
  • Set up a local Virtual Machine, then install MySQL on the VM
    • This is my preference as it also allows me to get familiar with the OS (preferably Linux)
  • Set up a quick Amazon EC2 Instance
    • This is easiest if you are comfortable with EC2, but can also be costly if you forget to turn off an instance or want to spend lots of time testing and experimenting

For the sake of folks getting their feet wet, I’ve setup a Virtual Appliance that you can import and start using right away:

https://s3.amazonaws.com/okcmysql/MySQL-Testbed.ova

The rest of this post and Part 2 will be a step-by-step guide on getting starting with the above appliance.  So lets get started!

Step 1: Install Virtual Box

The details of this installation are outside of the scope of this post, but it should be very straight forward.  Simply download and install Virtual Box for your particular OS (available for Windows, OS/X, and Linux) from here:

Then follow the installer instructions as you would any other application.

Step 2: Download and import VBox appliance

To save time and help those that may not be comfortable with setting up a Linux OS, I’ve built out a pre-configured CentOS appliance (https://s3.amazonaws.com/okcmysql/MySQL-Testbed.ova) with:

  • CentOS 6
  • Percona Server 5.6 (current stable at time of this post)
  • Host-only network card for local connections
  • Some other various configuration options
    • MySQL starts at boot
    • Disable firewall
    • Disable selinux
    • etc

Please note that this configuration IS NOT suited for production use, but rather to serve as a quick sandbox source for testing and experimentation (and can also be leveraged by those unfamiliar with linux as a primer).

a. Open virtual box 01-OpenVboxb. Select File -> Import Appliance

02-ImportAppliance-Menu

c. Select the OVA file you downloaded above 03-ImportAppliance-Selectd. Click “Continue”, you should see a verify screen, then click “Import”04-CheckSettingse. Select and start the newly created VM:05-StartVMf. You should now see the newly started VM:06-VerifyVMStart3. Install MySQL Workbench

Based on the majority of feedback I’ve gotten, it appears that many in the group are much more comfortable in Windows using a GUI (as opposed to straight CLI usage).  I’ll walk through some CLI details in other posts (as that is my preference), but will use MySQL Workbench for the rest of this tutorial.

a. Download / Install MySQL Workbench (https://dev.mysql.com/downloads/workbench/):07-DownloadWorkbenchb. Open Workbench and “Add New Connection”:08-OpenWorkbench-AddConnectionc. Name the connection “MySQL Testbed” and set the following:

  • Hostname: 192.168.150.150 (note this is the host-only network within VBox)
  • Port: 3306 (this is standard port and shouldn’t need to be edited)
  • Username: tester
  • Password: password1

10-DefineTestConnectiond. Then click “Test Connection” and “OK”, assuming you see success:11-TestConnectionVerify(Update!) Part 2 of this post will work through some basic interaction with the database using Workbench, but you should be all set up at this point!

Comments

comments

One thought on “Installing MySQL for Testing – Part 1”

Comments are closed.