Step by Step to find the PrestaShop Database Config file

How to find the PrestaShop Database config file to get the necessary information you forgot?

Your database connection can be established in the PrestaShop configuration setting by adding your database username, password, hostname, and database name. Once you are connected to your databases, the Prestashop framework knows all the tables you are using in your installation.

Feel free to get this information from the configuration file if you missed them.

PrestaShop database config file

What is a config file, and what is its purpose?

A config file is a PHP file that contains basic configuration information for an online store. You can customize and override any of the settings in this file.

In general, it contains the following information: database connection details for MySQL and PostgreSQL, secret key...

These are important data and if any data of these provide is missed, the site will either not function or run incorrectly.

This information is stored in a parameters.php file.

Where is the Database Config File located?

The place to store this file in PrestaShop 1.6 & 1.7 is not the same. This can be confusing for some people.

In PrestaShop 1.6, the default place for the config file is at the config folder in the root folder of your store's domain name:

your-website/config/parameters.php

In PrestaShop 1.7, the default place for the config file is at the config folder inside app folder:

your-website/app/config/parameters.php

This was changed to make it easier to manage configurations, but this has caused some confusion among users who do not know.

 
  array (
    'database_host' => '127.0.0.1',
    'database_port' => '',
    'database_name' => 'mystore',
    'database_user' => 'myadmin',
    'database_password' => 'a424SSd#',
    'database_prefix' => 'ps_',
    'database_engine' => 'InnoDB',
    'mailer_transport' => 'smtp',
    'mailer_host' => '127.0.0.1',
    'mailer_user' => NULL,
    'mailer_password' => NULL,
    'secret' => 'WsdfsdWiiwFBhpH5touUzBFKzRqLGgYxu6fsfSSH5ssv',
    'ps_caching' => 'CacheMemcache',
    'ps_cache_enable' => false,
    'ps_creation_date' => '2021-08-10',
    'locale' => 'en-US',
    'use_debug_toolbar' => true,
    'cookie_key' => 'cfsdf98wrMkgpIPYG1MoVQ1zhADGGFDGz2B4BuB3',
    'cookie_iv' => 'qwxmkkfsdfs7ZgSgjnKbToXLpNzypKO',
    'new_cookie_key' => 'def00000d264b27sdfsf0bb8bfb80f6c4600a612a710f4062e2569f25a60sdfsg93261edd970783fb50d77dde6',
  ),
);

Is there a way to edit this configuration file?

Yes, the file can be edited by hand.

Use an FTP client to connect your FTP server and download the database configuration file into your local PC.

Which one should I use?

In my opinion, FileZilla or Remote FTP for Atom are good choices for this file transfer task.

But it is recommended to use a file manager tool from your hosting provider. It will help you save time and energy when editing this file.

Why is this important?

The default place for the config file in PrestaShop 1.6 & 1.7 is not the same, so when you change settings, you have to know where your store's configuration file is located.

By knowing this information, it will make you more effective and efficient.

In order to move your PrestaShop store to a new domain or change other information related to database settings after installation, such as the database name or database server, you need to correct this information by editing this file with a file manager.

PrestaShop database config

If your site is installed for a long time, you will forget the database configuration. Accessing the database information section of the file is an easy way to restore whatever you want.

This file contains not only the database connection data but also other advanced parameters such as the cookie key. It's very helpful to use the cookie key to recover the accessing to PrestaShop Admin Panel Dashboard from the database follow my tutorial.

Last but not least, don't forget to back up this PrestaShop database config file every time you edit it.

PrestaSOO team
Everything you need to make a living doing work you love.

Discover

It is a wise investment

Prestashop modules we created first to solve the problem of our own business - an e-Commerce site. That means they are very useful for a serious business. If you value your web property, these modules are a wise investment.
Sarah Reeves, App Developer @ PrestaSOO
Made with in Paris & Hanoi
PrestaSOO © 2021. All rights reserved. // Privacy Policy Terms of Service