Create Moodle site database
Moodle supports MySQL, PostgreSQL and MS SQL 2005 and Oracle databases. Other databases may also work with Moodle.
If your Moodle installer, does not create or add to an existing MySQL database, these instructions may help you.
Reading Homework for 4/26/12
Tonights homework is going to be reading for 10 minutes and then answer these questions
1) Did you like this book 2) Was this your Favorate Book 3) What was the book Called
for more info go to my other website
Alternative
If you want to run all this at once without so many commands then copy and paste the lines below into the mysql command line.
create database moodle default character set utf8; grant all privileges on moodle.* to 'moodleuser'@'localhost' identified by 'yourpassword'; flush privileges; quit
- Note: 'Grant all' gives a lot of privilege to the moodleuser account.
PostgreSQL
And some example command lines for those who wish to use a PostgreSQL database:
# su - postgres > psql -c "create user moodleuser createdb;" template1 > psql -c "alter user moodleuser with encrypted password 'yourpassword';" template1 > psql -c "create database moodle with encoding 'unicode';" -U moodleuser template1 > psql -c "alter user moodleuser nocreatedb;" template1 > su - root # /etc/init.d/postgresql reload
If the Postgres create user command above (>psql -c "create user moodleuser...") gives an error message you may want to try initdb as postgres, then restarting postgresql as root, then start steps again from the beginning:
initdb -D data su # /etc/init.d/postgresql restart
If the Postgres create database command above (>psql -c "create database moodle...") gives an error message you may want to try:
psql -c "create database moodle with template=template1 encoding = 'unicode' owner = moodleuser
location = '/var/mydata';"
If the create database command asks you for a password, run the line containing 'encrypted password' first before proceeding.
Using a SQLite database
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Moodle 2.0 offers experimental support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle's data directory (see Creating the data directory). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file. Continue with Creating the data directory |
Using a hosted server
If you are using a webhost, they will probably have a control panel web interface for you to create your database.
The cPanel system is one of the most popular of these. To create a database using cPanel:
- Click on the MySQL Databases icon.
- Type moodle in the New Database field and click Create Database.
- Type a username and password (not one you use elsewhere) in the respective fields and click Create User.
Note that the username and database names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names. - Now use the Add Users to Databases button and give this new user account ALL rights to the new database.
Continue with Creating the data directory
Caution- be aware of Moodle version requirements
See the [download page] at Moodle.org or PHP settings by Moodle version for supported database requirements for each version of Moodle.
For example Moodle 2.0 requires:
* MySQL 5.0.25 or later (InnoDB storage engine highly recommended) * PostgreSQL 8.3 or later * Oracle 10.2 or later * MS SQL 2005 or later
See also
- Installing Moodle
- Step-by-step instructions on installation for Ubuntu(Debian)