1. Open php MyAdmin
  2. Run Query :
    • Select @@sql_mode;
  3. The result will be somthing lik:
    • ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  4. Run the query :
    • SET global sql_mode=(SELECT REPLACE(@@sql_mode, ‘ONLY_FULL_GROUP_BY’, ”));
  5. Run Query :
    • Select @@sql_mode;
  6. The result will be somthing lik:
    • STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  7. Now we need to add a sql_mode value to [mysqld] to prevent sql_mode value retuned to previous default ;

Now we need to add a sql_mode value to [mysqld] to prevent sql_mode value retuned to previous default

  1. Open Terminal
  2. Type :
    • cat /etc/my.cnf
  3. You will see the my.cnf content
  4. Type:
    • nano /etc/my.cnf
  5. Add following line to end of the fileunder  [mysqld] :
    • sql_mode = “STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
  6. Enter Ctrl + O to “WriteOut” or save the settings.
  7.  Press Enter

Now you need to restart MySQL service

  1. Restart MySQL from cPanel
  2. Or from Terminal :
    • sudo service mysql stop
    • sudo service mysql start
  3. To check if everything is fine just check mysql variables set correctly
    • from cpanel
    • Or from Terminal type:
      • mysqladmin variables