If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

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

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