Selamat Datang di Rumah Aiyra

Thursday 2 July 2020

Mengatasi error mysql_full_unicode_support#File_format di moodle



Ketika instal atau upgrade moodle  dihalaman hosting
anda mengalami  error pada mysql_full_unicode_support#File_format 
Hal ini tidak mendukung utf8mb4

Langkah yang anda harus lakukan adalah

Cari file  config.php
kemudian edit  config.php

Silahkan anda  mengubah      ‘dbcollation’ => ‘utf8mb4_unicode_ci’, 
menjadi      ‘dbcollation’ => ‘utf8_unicode_ci’,   atau  ‘dbcollation’ => ‘utf8_general_ci’,

jika sudah klik tombol save, dan klik reload di installasi moodlenya

Selanjutnya lanjutkan installasi moodle



Apabila terjadi masalah lainnya:

1) Wrong $CFG->dbtype : you need to change it in your config.php file, from 'mysql' to 'mariadb'.
Untuk error ini cara memperbaikinya adalah dengan merubah di file config.php, cari baris $CFG->dbtype = 'mysqli'; dan ubah menjadi $CFG->dbtype = 'mariadb';

2) Intl extensionis required to improve internationalization support, such as locale aware sorting and international domain names
Untuk memperbaiki error ini silahkan edit file php.ini di folder xampp/php/php.ini kemudian hilangkan tanda ";" pada baris ;extension=intl, sehingga menjadi extension=intl

atau login di cpanel
buka menu Select PHP Version
cari intl dan ceklish intl




kemudian save

3) mysql_full_unicode_support#File_format
Untuk memperbaiki error pada bagian ini silahkan buka file my.ini yang ada di xampp/mysql/bin/my.ini, kemudian tambahkan beberapa baris berikut:
[client]
default-character-set = utf8

[mysqld]character_set_server=utf8

[mysql]
default-character-set = utf8


4) mysql_full_unicode_support#Large_prefix
Untuk memperbaiki error pada bagian ini silahkan buka file my.ini yang ada di xampp/mysql/bin/my.ini, kemudian tambahkan beberapa baris berikut:
[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

Selain itu juga lakukan perubahan pada file config.php pada moodle dan ubah baris :
'dbcollation' => 'utf8mb4_general_ci',
menjadi
'dbcollation' => 'utf8_general_ci',

          Penting:
  • langkah nomor 1 dan 2 dibutuhkan restart Apache, Sedangkan langkah 3 dan 4 membutuhkan restart MySQL, lakukan Stop dan Start kembali dari XAMPP Control Panel.
  • Untuk membuka file php.ini dan juga my.ini, dapat juga dilakukan dengan mengklik tombol config pada XAMPP Contol Panel



Apabila menemukan masalah ini:

Debug info: COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'utf8'
SELECT 'x' FROM mdl9s_user WHERE LOWER(email) COLLATE utf8mb4_bin = LOWER(?) AND mnethostid = ? AND id <> ? LIMIT 0, 1
[array (
0 => 'elma@iainpalopo.ac.id',
1 => '1',
2 => -1,
)]
Error code: dmlreadexception

Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 2002 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
line 1987 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
line 310 of /user/editadvanced_form.php: call to moodle_database->record_exists_select()
line 653 of /lib/formslib.php: call to user_editadvanced_form->validation()
line 589 of /lib/formslib.php: call to moodleform->validate_defined_fields()
line 699 of /lib/formslib.php: call to moodleform->is_validated()
line 171 of /user/editadvanced.php: call to moodleform->get_data()

Cara mengatasinya adalah:


Edit config.php and find the 'dbcollation' line:

$CFG->dboptions = array (
  ⋮
  'dbcollation' => 'utf8mb4_bin',
);

Change the 'dbcollation' to 'utf8_unicode_ci'.

1 comment:

  1. Thank you for this great post! Great Value! I will bookmark it looking forward to receiving the next coming updates!
    My name is Youssef. I am an Internet Business Marketer and SEO Expert, I have been working in this industry for more than 14 years.
    I have been helping small scale businesses to rank their websites online and boost their revenues by the traffic they generate.
    To help any starting company or anyone running out of budget. I have created these great amazing SEO tools.
    There are litterally more than 60 free SEO tools.
    If you are interested then here are The best free SEO tools online

    ReplyDelete

Jangan Lupa "Post a Comment" dengan memberi saran, kritikan yang dapat membangun perbaikan content isi Blog Rumah Aiyra . Terima Kasih

Ikuti Perkembangan Rumah Aiyra