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:
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:
- Windows (http://download.virtualbox.org/virtualbox/4.3.28/VirtualBox-4.3.28-100309-Win.exe)
- OS/X (http://download.virtualbox.org/virtualbox/4.3.28/VirtualBox-4.3.28-100309-OSX.dmg)
- Linux (https://www.virtualbox.org/wiki/Linux_Downloads)
- General Downloads Page (https://www.virtualbox.org/wiki/Downloads)
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
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).
c. Select the OVA file you downloaded above d. Click “Continue”, you should see a verify screen, then click “Import”e. Select and start the newly created VM:f. You should now see the newly started VM:3. 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/):b. Open Workbench and “Add New Connection”:c. 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
d. Then click “Test Connection” and “OK”, assuming you see success:(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!