Opencart – Auto-update currency issue

Hello Friends,

I feel very happy to meet you all after a long break. This time, I am obliged to discuss an another third party issue which I have faced a lot many number of times. In OpenCart, I have come across few instances of below given error :
Fatal error:  MySQL server has gone away<br />Error No: 2006<br />UPDATE oc_currency SET value = ‘1.00000‘, date_modified = ‘20150221 05:56:24‘ WHERE code = ‘USD in /home/username/public_html/<site>/system/database/mysqli.php:41

This error usually happens in OpenCart software installed in shared hosting environment where there won’t be enough mysql resource parameters to run the currency update query.

To resolve this issue, the option “Auto update Currency” should be turned OFF. This can be turned Off or On from your OpenCart Admin itself. The steps are as follows:
Store Admin >> System Menu >> Settings >> Store >> Local Tab 
There you will be able to find the option “Auto update Currency” 

However, this error actually prevents you from entering in to your OpenCart Admin. So we may need an alternative way to turn off the “Auto Update Currency” option.  Here is the one of the way to do it.
1) Find the Opencart DB. You can find it in config.php file.
2) Open the DB (either using PHPmyAdmin/TOAD or shell)
3) Find the table “oc_setting“. I would suggest you to search for setting keyword since the table prefix will not be ‘oc_‘ everywhere.
4) Now search for the key “config_currency_auto“.
5) If it is On, it will be set to ‘1‘. To turn it Off, you may need to set it to ‘0
6) One line MySQL query to do this (in case you are doing this via shell)

UPDATE `oc_setting` SET `value` = 0 WHERE `key` = 'config_currency_auto';


Now all done. Now you should be able to login to your OpenCart  Admin with out any problems. You can see in the “Local Tab” that the Auto update Currency option is set to Off.

I hope my posts are helping you guys. I will meet you guys in my next post soon. Have a Great Day 🙂 🙂



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s