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!

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Routing all mails to a smarthost with SMTP Authentication

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

Virtuozzo : RTNETLINK: Operation Not Supported

Here is a new bug which I faced on virtuozzo 4 and 4.6 for Centos 6 VPS.   VPS fails to...

Fixed: The URI you submitted has disallowed characters.

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

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...