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.
What is a config file, and what is its purpose?
The PrestaShop 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 anytime after finishing the PrestaShop installation..
In general, it contains the following information: database connection details for MySQL database and PostgreSQL, secret key...
These are important data and if any data of these provided 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 the app folder:
your-website/app/config/parameters.php
The physical URL of this PHP configuration file was changed to make it easier to manage configurations, but this has caused some confusion among users who do not know.
return array (
'parameters' =>
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' => 'WsdfsdWiiwFBhpH5touUzBv',
'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' => 'def00000d264b27sdfsf0bb8bfbe6',
),
);
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 PrestaShop website'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.
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 following my tutorial.
Last but not least, don't forget to back up this PrestaShop database config file every time you edit it.