Disable MySql Strict Mode di cPanel/WHM

sebelum melakukan sesuatu alangkah baiknya membackup mysql configrasi nya terlebih dahulu:

cp -rp /etc/my.cnf /etc/my.cnf.backup
cp -rp /usr/my.cnf /usr/my.cnf.backup

Kemudian lakukan edit:

nano /etc/my.cnf

Tambahkan baris seperti di bawah ini:

[mysqld]
sql_mode="NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Kemudian simpan file. Jika kamu menggunakan mysql 5.6 lakukan perubahan juga pada file /usr/my.cnf:

nano /usr/my.cnf

Secara default seperti ini:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Ubah menjadi:

sql_mode="NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Simpan file lagi. Sekarang lakukan restart mysql:

service mysql restart

Terakhir lakukan test dengan menjalankan perintah:

mysql -e 'select @@GLOBAL.sql_mode;'
+----------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode |
+----------------------------------------------------------------------------------------------------+
| NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+----------------------------------------------------------------------------------------------------+

Jika hasil yang keluar seperti di atas mysql strict mode sudah ter disabled!

Was this answer helpful?

 Print this Article

Also Read

Replace a failed harddisk in Linux software RAID

Ini adalah contoh anda memiliki 2 hard disk, /dev/sda dan /dev/sdb, dengan partisi /dev/sda1 dan...

Fixed: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference

Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given...

Exim Error: Ratelimit database not available

If you find any of the following errors below in your /var/log/exim_mainlog log file. The fix...

Fixed: The URI you submitted has disallowed characters.

In codeigniter 1.7.x version if you find “The URI you submitted has disallowed...

Routing all mails to a smarthost with SMTP Authentication

Pergi ke halaman "Exim Configuration Editor" di WHM. Pilih "Advanced Editor". Add a...