PrestaShop is a popular e-commerce platform that allows you to create and manage your online stores effectively. A fundamental part of PrestaShop configuration is the correct database setup. The database stores critical information about products, customers, orders, and more. Therefore, it is crucial to ensure it is configured correctly to guarantee optimal performance of your online store.
In this guide, we will show how to configure your PrestaShop database and the necessary steps to do so.
The PrestaShop database configuration is based on a file within your web installation that establishes the connection with the database, where you must specify the database username, password, host name, and the database name. Once connected to your database, PrestaShop recognizes all the tables used in your installation.
These details are vital for PrestaShop to function and can be modified from the hosting files via FTP. This process applies to PrestaShop installations that already have a database created. If it is a completely new database, the process is exactly the same, but you will need to import the necessary content into the new database.
Below, we will explain how to modify the configuration file depending on the PrestaShop version you have installed:
To make these changes, you must access your hosting files. We recommend making the change using our webFTP tool.
Note: The website files are located inside the /web folder. If PrestaShop is installed inside a specific folder, you must access that folder.
Configure PrestaShop 1.7 Database
Configuration File Location: /web/app/config/parameters.php
In this file, you must edit the following lines to configure your database:
define('_DB_SERVER_', localhost);
define('_DB_NAME_',
'your_database_name');
define('_DB_USER_', 'your_MySQL_username');
define('_DB_PASSWD_', 'your_MySQL_user_password');
Save the changes in the file to complete the configuration.
Configure PrestaShop 1.6 Database
Configuration File Location: /web/config/settings.inc.php
To configure the database connection, locate and modify the following constants:
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_',
'your_database_name');
define('_DB_USER_', 'your_MySQL_username');
define('_DB_PASSWD_', 'your_MySQL_user_password');
IMPORTANT: You must replace the text “DB_NAME” with the name of the database you created in the hosting panel. You must also replace “DB_USER” and “DB_PASSWD” with your hosting MySQL username and password, respectively.
By following these steps, your PrestaShop will be correctly configured to point to the database created in your hosting, as long as all the provided data (host name, database name, username, and password) are entered correctly. Please note that database configuration is usually performed only once and does not require frequent modifications.