Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

pdf icons

Creating MySQL Database and User for Moodle

The install process of Moodle creates a set of MySQL tables and populates some of them with appropriate (default) data.

It's best to create a separate database named moodle under MySQL so that Moodle has its own reserved data storage area under MySQL into which it will place its tables and populate them with default data appropriately.

Additionally, create a MySQL user named moodle. Protect this user with a password and finally grant this user with full rights to the resources held in the moodle database.

Creating Database Under MySQL

Open a Command Window:

Start –> Run -> cmd as shown in diagram 1 and diagram 2

start.jpg
Diagram 1

cmd.jpg
Diagram 2

At the system prompt Login to MySQL with login id and password created at the time of installing MySQL as shown in Diagram 3 and Diagram 4.

NOTE: The installation of MySQL is available at.(http://www.opensourcevarsity.com/mysqlbasics/l3mysqlinstallation)

mysql1.jpg
Diagram 3

mysql2.jpg
Diagram 4

At the mysql> prompt enter:
mysql> CREATE DATABASE moodle;
Output:
Query OK, 1 row affected (0.00 sec)

5moodledb.png
Diagram 5

MySQL responds by immediately creating the moodle database.

Creating Moodle User Under MySQL

Next create the user moodle and grant this user all rights on the moodle database controlled by a password.

NOTE: This information (username, password and database name) will be required at the time of installing Moodle. Write them down and store them safely for future use.

At the mysql> prompt enter:
mysql> GRANT ALL ON moodle.* TO moodle@localhost IDENTIFIED BY '{use any password here greater than 8 characters}';

NOTE: Do not forget the single quotes that surround the password value.

NOTE: Upper and lower case are not important. Use all lowercase if you wish. Uppercase has been used to add some clarity to the MySQL command.

Output:
Query OK, 0 row affected (0.03 sec)

grantinguserpermission
Diagram 6

This will create a user moodle, who can login to MySQL only from the local machine and will be identified by the password {password set above}.

Once complete an empty moodle database is ready for use. This only be accessed by a registered MySQL user named moodle, who has all rights on the moodle database.

Since these steps are complete all that is left is to run the Moodle Installation PHP scripts within the Moodle core downloaded earlier.

The next tutorial steps you through what you need to do on your local computer just prior actually going through with installing Moodle CMS on your local computer.

OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download
LinkShare_180x150
Artisteer - DNN Skin Generator
Tapestry Theme - A Tumblog-Style Theme for Wordpress