Page 1 of 1

Solution - Installing WHMCS mysql strict mode error

Posted: Wed Apr 19, 2017 12:18 am
by adamjedgar
Hi guys,
this is a simple fix, but since i experienced others may as well, so i have added the answer here just in case it isnt already discussed.

when installing whmcs, one may encounter the whmcs error "strict mode detected, please disable strict mode" when attempting to connect to a database.

The simple solution for this is as follows (note i am using ubuntu 16.04)

from command shell i changed to root user as shown in the line below (may not be necessary but i did it anyway as i wanted to ensure i had no problems)

sudo su
cd /usr/local/vesta/conf/
dir (to check that the mysql.conf is actually here)
vi mysql.conf
copy your root user password (or write it down somewhere)
hit esc key on keyboard then type ":q" (without quotes) to exit vi

in browser, goto "http://<yourdomain>.com/phpmyadmin" (if it automatically logs you in, log out to get back to the phpmyadmin login screen)

log into phpmyadmin as "root" (use the password you copied from mysql.conf)

go to top of screen and select "Variables" tab

scroll down until you see "sql mode" (they are in aphabetical order)

Click "edit"

in the highlighted box on rhs remove "STRICT_TRANS_TABLES"

After removing the text above, I was left with the following in this box (i suspect i may need to edit this further)
ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


EDIT...I ended up removing everything from the above box as installation failed again with a different error. After removing everything, install completed successfully. I will leave it to more experienced people than i to explain what is needed and not needed in SQL MODE

Click "save"

log out

Go back to your whmcs installation and continue configuration.

Believe it or not i got this solution from a Godaddy forum (a bit of a shock considering Godaddy apparently doesnt allow disabling of strict mode on shared hosting where this question was raised...not that one should be reselling hosting on shared anyway, but it might be worth keeping in the back of ones head just in case one needs pulling power for a client who thinks they should move to godaddy)

Hope this helps others who may strike this problem.

Re: Solution - Installing WHMCS mysql strict mode error

Posted: Sat Aug 19, 2017 3:38 pm
by MAN5
My server is Ubuntu 16.04, PHP5.6 / WHMCS7.2
I edited >
/etc/mysql/my.cnf
add/edit the attribute 'sql_mode' under '[mysqld]'
sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Then restart the MySQL services
service mysql restart
thats it.