Skip to main content
MySQL Database
Setting up the MySQL Database
- Log into MySQL as root, providing the password at the prompt
mysql -u root -p
- Create the database with the command below
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Create a user/password combination with appropriate permissions for the database (replace moodle, moodleuser and yourpassword with an appropriate database name, username and password)
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodleuser'@'localhost' IDENTIFIED BY 'yourpassword';
- Flush the privileges
flush privileges;
- Exit the database
exit;