Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix the "Unicode format UTF-8" Error in Moodle Setup

While installing Moodle by hand, the installer may say your database must use UTF-8. This guide shows how to fix it.

Web Hosting2 min read12 steps1 screenshots

What does this error mean?

Moodle is a free tool for running online courses. It stores its data in a database, which is an organised store of information. UTF-8 is a text format that can hold letters from every language, plus symbols and emoji. Moodle needs the database to use UTF-8. If the database was made with another format, the installer stops with a "Unicode format UTF-8" message.

Warning: The fix below can change a database. If it already holds data, take a backup first. A fresh, empty database is safest.

Fix 1: Create a new database with UTF-8

This is the easiest way when Moodle is not installed yet.

  1. Log in to your hosting control panel.
  2. Open MySQL Databases or MySQL Database Wizard.
  3. Create a new database and a new database user.
  4. Add the user to the database with all privileges.
  5. Open phpMyAdmin, which is a web tool to manage databases.
  6. Click your new database. Then click the Operations tab.
    Unicode format UTF-8
  7. Find Collation. Choose utf8mb4_unicode_ci. If you do not see it, choose utf8_general_ci.
  8. Click Go.

Collation is the rule set that decides how text is stored and sorted.

Fix 2: Check the database type in config.php

Moodle has a settings file called config.php. Open it in the File Manager and look at these lines:

$CFG->dbtype = 'mysqli';
$CFG->dbname = 'your_database_name';
$CFG->dbuser = 'your_database_user';

Make sure the name, user and password match the new UTF-8 database. If you use MariaDB, the type may be mariadb.

Try the installer again

  1. Open your Moodle address in the browser.
  2. Go through the installer steps again.
  3. Enter the details of the new database when asked.
  4. Continue to the end.
Tip: If you cannot change the collation or the error stays, open a support ticket. Tell us the exact error text.

Quick recap

  • Moodle needs its database to use UTF-8.
  • The error appears when the database uses another text format.
  • Make a new database and set its collation to utf8mb4_unicode_ci.
  • Match the details in config.php and run the installer again.
  • Back up any database that already has data.