4

I am very new to Moodle. When i am trying to install this i got this issue(Please ref screenshot). enter image description here

Can any one help me regarding this?

Thank you in advance. Omkar

omkar
  • 1,778
  • 3
  • 13
  • 15

3 Answers3

11

This is very common problem, people often face, even i did face too. When installing moodle latest 3.2+ it checks for enabled support for utf8mb4 charset in MySQL database. This doesn't come by default in MySQL. You need to set few parameters in mysql conf.

On Linux based systems you will want to alter my.cnf. This may be located in '/etc/mysql/'. Make the following alterations to my.cnf:

[client]
default-character-set = utf8mb4

[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake

[mysql]
default-character-set = utf8mb4

Post changing the values, restart mysql and the error should be fixed now.

Please refer below docuemnt

https://docs.moodle.org/32/en/MySQL_full_unicode_support

https://mathiasbynens.be/notes/mysql-utf8mb4#character-sets

Bishwanath Jha
  • 399
  • 3
  • 10
7

I had the same issue this helped me, Go to phpmyadmin and copy the collation for information schema In my case information_schema -> utf8_general_ci

enter image description here

Now go to htdocs/moodle/config.php and alter this section

$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8_general_ci',
);

Note- here change only the dbcollation to 'utf8_general_ci' and refresh the installation page this will solve both the errors

Savan
  • 161
  • 3
  • 11
3

Please install (or access) phpmyadmin and execute SQL

set Global innodb_file_format = Barracuda
set Global innodb_file_per_table = 1
set Global innodb_large_prefix = "ON"
  • 1
    It'd be helpful if you describe how this solves the questioner's problem (and why). – bill.lee Jul 05 '17 at 21:08
  • Awesome! This just worked out and allowed me (no ssh access) to solve the issue and continue installing – CarpinchoDem Mar 27 '18 at 10:38
  • Is it safe to "assume" that innodb_file_format will always be Barracuda on all servers? Is there anything you should check before running that "set Global innodb_file_format = Barracuda" command? – luisdev Sep 04 '20 at 06:14