If you need to update the database credentials for your PrestaShop 8 installation, follow these simple steps. Changing the database host, username, password, or database name can be necessary when migrating to a new server or changing your hosting provider.
Step 1: Access Your Files
- Connect to Your Server: Use an FTP client like FileZilla or access your server via cPanel.
- Locate the PrestaShop Directory: Navigate to the directory where PrestaShop is installed.
Step 2: Open the Configuration File
- Find the
config
Folder: Inside your PrestaShop directory, locate theconfig
folder. - Edit the
parameters.php
File: Open theparameters.php
file located in theconfig
folder. This file contains your database configuration settings.
Step 3: Modify Database Credentials
In the parameters.php
file, you will see an array structure that includes database settings. Look for the following lines:
'database_host' => 'your_host',
'database_port' => 'your_port', // optional
'database_name' => 'your_db_name',
'database_user' => 'your_db_user',
'database_password' => 'your_db_password',
Update the values accordingly:
database_host
: Change this to your new database host (e.g.,localhost
or an IP address).database_name
: Enter the name of the new database.database_user
: Update this with the new database username.database_password
: Enter the new database password.
Make sure you save the changes after modifying these lines.
Step 4: Test Your Changes
- Check Your Website: After saving the
parameters.php
file, visit your PrestaShop website. - Look for Errors: If everything has been configured correctly, your website should run without errors. If there’s a problem, you may see a database connection error.
Step 5: Clear Cache (Optional)
If you encounter any issues, try clearing the cache:
- Access PrestaShop Back Office if possible.
- Go to Advanced Parameters > Performance.
- Clear Cache: Click on the “Clear Cache” button.
Conclusion
Changing database credentials in PrestaShop 8 is a straightforward process that involves editing a single configuration file. Always ensure to back up your configuration files before making any changes. Following these steps will help you successfully update your database credentials and keep your PrestaShop store up and running.
Picture from https://pt.vecteezy.com/membros/naki-sama