Categories

Featured templates

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

Daniel Morales August 31, 2015
Rating: 5.0/5. From 2 votes.
Please wait...


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

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

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_1

Solution 1

  1. First, log into the cPanel dashboard.

  2. Locate and enter the File Manager.

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

  4. From here, click on the config.php and admin/config.php files, then open them for editing.

  5. 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');
  6. Save Changes. Refresh the website to see that message is gone.

Solution 2

Your server might require ‘mmysqli’ database driver to fix the issue.

  1. Download the file ‘mmysqli.php’ to your hard drive.

  2. Upload it to /system/database/ folder on your server.

  3. Open config.php and admin/config.php files on the server for editing.

  4. Locate the following line:

    define('DB_DRIVER', 'mysqli');
  5. Change it to:

    define('DB_DRIVER', 'mmysqli.php');
    
  6. Save Changes. Refresh the website to see that message is gone:

    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_2

Feel free to check the detailed video tutorial below:

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

Premium OpenCart Themes
This entry was posted in OpenCart Tutorials and tagged deprecated, MySQL, opencart, troubleshooter. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket