Installing MySQL on Windows
Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Installing MySQL on Windows.
After installing Apache, then PHP, the third leg is to install MySQL. MySQL appears to be the preferred database for Moodle, but it does have its quirks. You may want to use PostGres, which is an excellent database tool, or MSSQL, or Oracle.
It is assumed here that the file you have downloaded is the mysql-5.1.38-win32.msi file. This installation is for a standalone test server, in preparation for when it is ready to be uploaded to our production site. However, the same principles of installation are applied even to a Windows Server.
Installing the MySQL Server
When downloaded, right click the mysql-5.1.38-win32.msi file (the file I downloaded, but yours may have a different version number.) Select Install and then "Run"
Select "Custom Setup"
Change path to what you want, say g:\mySQL so select new path New Folder navigate to G:\ and add mySQL as a destination folder name. (What you use is up to you.)
Do not try to change destination of the data folder, it will get frustrating. Click "Install" and it will copy all the files it needs to the destination.
In some versions of the installer there is a set of ads for MySQL Enterprise version which you can safely ignore.
It will take you to the "Wizard Complete screen, and ask you if you want to configure MySQL now and register.
You can always register later, so uncheck the box and click Finish which will take you to the Configuration Wizard.
After installing MySQL, you now need to make it usable in Windows, to configure it to what you need.
Click next and it will ask you if you want a "Detailed Configuration" or "Standard Configuration" for our purposes, we want a Detailed Configuration and click Next.
The next screen basically asks for what kind of use are you putting the MySQL server to, for out purposes we want a generic server machine, and click Next
Select Multifunctional database here, we do not know what we will want MySQL to be doing next year, so play it safe, select the generic option. Click Next.
The InnoDB TableSpace Settings can go into the same path as our database. Click Next.
For our purposes, we need only set a manual operation for no more than 15 connections. If you were installing a production site, you would want OLTP. Click Next.
Enable TCP/IP, and accept the default port setting, but make sure you click the Add firewall exception option. Accept the Enable Strict Mode as well. Click Next.
Here we need to remember that Moodle uses a Collation and the UTF-8 character set, so MySQL needs to accommodate this. Select "Manual Selected Default Character Set/Collation" option. From the drop down list, select UTF-8.
Accept installation as a Windows Service, but unless you are developing a database, you may not think you need to select the "Include Bin Directory in Windows path" option. As a general rule of thumb though, you may need to access mySQL from the command line at some stage, probably not, but sometimes, you may. Including this now is a set and forget option.
Here you need to enter a password, making sure it is the same password as you are going to use for your Moodle installation. For security purposes though, you may not want to enable root access from a remote machine, nor create an anonymous account.
NOTE: Makes sure you can easily remember the password you set here. You wll need to to install Moodle properly.
Thinking over what you have done, are you happy with the options you have selected, of so, select Execute and go and make a tea or a coffee, or what you want, while mySQL installs.
When complete, we can look to see if it is all installed properly. We know Apache and PHP are working, so now it is the turn of mySQL.
Testing the MySQL Server Installation
MySQL should now appear in the Start Menu, so you can acess mySQL, and MySQL Command line Client.
which brings up a Windows cmd dialogue box. At the prompt enter your password, and it should respond with "Welcome to the MySQL monitor..." with some more text and commands, ending with the mysql> prompt. If this works, then it is all well.
Enter exit and that should take you out of the cmd box as well.
You can now prepare to install Moodle.