Note: You are currently viewing documentation for Moodle 2.1. Up-to-date documentation for the latest stable version is available here: MySQL.

MySQL: Difference between revisions

From MoodleDocs
No edit summary
Line 10: Line 10:
* There are installers available for most popular operating systems at http://www.mysql.com/downloads/mysql/.
* There are installers available for most popular operating systems at http://www.mysql.com/downloads/mysql/.
* It is possible and reasonably straightforward to build mysql from source but it is not recommended (the pre-built binaries are supposedly better optimised).
* It is possible and reasonably straightforward to build mysql from source but it is not recommended (the pre-built binaries are supposedly better optimised).
* Make sure you set a password for the 'root' user.
== Creating Moodle database ==
These are the steps to create an empty Moodle database. Substitute your own database name, user name and password as appropriate.
=== Command line ===
* To create a database using the 'mysql' command line client, first log into MySQL
<pre>
$ mysql -u root -p
Enter password:
</pre>
(Enter the password you previously set for the MySQL 'root' user). After some pre-amble this should take you to the ''mysql>'' prompt.


== See also ==
== See also ==

Revision as of 13:03, 1 December 2011

MySQL is one of the supported databases that underpins a Moodle installation.

MySQL describes itself as "the most popular Open Source SQL database management system, is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers. It is a second generation Open Source company that unites Open Source values and methodology with a successful business model."

MySQL comes with an array of storage engines. The popular ones being MyISAM and InnoDB. Since MySQL 5.5.5, MyISAM was dropped as default and InnoDB was made the default storage engine of choice. InnoDB is more well supportable than MyISAM due to known issues with MyISAM. MyISAM and non-ACID master-master setups can have issues which sometimes prove difficult to support.

Installing MySQL

  • If you are running Linux your preference should be to install using your distributions package manager. This ensures you will get any available updates.
  • There are installers available for most popular operating systems at http://www.mysql.com/downloads/mysql/.
  • It is possible and reasonably straightforward to build mysql from source but it is not recommended (the pre-built binaries are supposedly better optimised).
  • Make sure you set a password for the 'root' user.

Creating Moodle database

These are the steps to create an empty Moodle database. Substitute your own database name, user name and password as appropriate.

Command line

  • To create a database using the 'mysql' command line client, first log into MySQL
$ mysql -u root -p
Enter password: 

(Enter the password you previously set for the MySQL 'root' user). After some pre-amble this should take you to the mysql> prompt.

See also