Note: You are currently viewing documentation for Moodle 3.4. Up-to-date documentation for the latest stable version of Moodle is likely available here: Installing MySQL on Windows.

Installing MySQL on Windows

From MoodleDocs
Revision as of 05:36, 31 January 2010 by Colin Fraser (talk | contribs)

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.

When downloaded, right click the mysql-5.1.38-win32.msi file (the file I downloaded, but yours may be different.) Select Install and the "Run"

Select "Custom Setup"

Start MySQL installation

Change path to what you want, say g:\mySQL so select new path New Folder navigate to G:\add mySQL

Do not try to change destination of the data folder, it will get frustrating.

Click OK 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. Yuo can always register later, so uncheck the box and click Finish. This will then take you to the Configuration Wizard. 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 the UTF-8 character set, so MySQL needs to accomodate this. Select "Manual Selected Default Character Set/Collation" option. From tthe 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.

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.

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.


See Also