- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
OpenCart 2.x. Troubleshooter. How to get rid of the “Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future” message
August 31, 2015
This tutorial will show you how to get rid of the ‘Deprecated mysql_connect() The mysql extension is deprecated and will be removed in the future’ message in OpenCart 2.x.:
Solution 1
-
First, log into the cPanel dashboard.
-
Locate and enter the File Manager.
-
Once inside the File Manager, navigate to your store’s root folder. Most stores use the main domain, so the root folder will be public_html. If you are using a subfolder (e.g. example.com/shop), then you will look for public_html/shop.
-
From here, click on the config.php and admin/config.php files, then open them for editing.
-
Inside the editor, you will see the line of code that controls the mysql:
define('DB_DRIVER', 'mysql');
and replace it with:
define('DB_DRIVER', 'mysqli');
-
Save Changes. Refresh the website to see that message is gone.
Solution 2
Your server might require ‘mmysqli’ database driver to fix the issue.
-
Download the file ‘mmysqli.php’ to your hard drive.
-
Upload it to /system/database/ folder on your server.
-
Open config.php and admin/config.php files on the server for editing.
-
Locate the following line:
define('DB_DRIVER', 'mysqli');
-
Change it to:
define('DB_DRIVER', 'mmysqli.php');
-
Save Changes. Refresh the website to see that message is gone:
Feel free to check the detailed video tutorial below: