4. Direct Connection to MySQL Database

fmDirectConnection - fmPreferences

This section describes how to setup direct connection to your MySQL server using Store Manager for PrestaShop.

The following topics are covered:

1. Database Connection

Store Manager for PrestaShop requires direct MySQL database connection. Most of hosting companies allow direct connections to MySQL database.

However, in most cases, you have to go to your control panel and add your home/office computer IP address or domain name to Access List - list of IP addresses allowed to access MySQL port 3306 from outside.

This option can be found under MySQL settings.

Feel free to ask your hosting support to assist you in enabling direct MySQL access, they must help you since it is a trivial task.

To configure direct connection to your remote database, follow few steps:

1. Open Tools -> Preferences -> Database Connection Tab (F12)

2. Enable Direct connection to remote database check-box

Direct Connection type

3. Specify Remote Database Connection Settings.

In order to find your settings, please follow few steps:

      1. Open your store using any FTP Client (like FileZilla, or any other)
      2. Open your store root directory via FTP and go to config directory
      3. Open settings.inc.php file and you will find your database server name (host), username and password
      4. Copy them to Store Manager
  • Host (Server address) - Usually it is your website name like "mywebsite.com" (do not include http://www. prefix); you may use IP address as well.
      • define('_DB_SERVER_', 'localhost');
        • If localhost is specified here, you should use your store URL (without http://www).
  • Port - 3306 is used in most cases (please ask your hosting provider to check if the one is used).
  • User name (login), Password and Database (name) - Specify your username, password and database name. You can find them in settings.inc.php file as well:

define('_DB_NAME_', 'your_database_name_goes_here');

define('_DB_USER_', 'your_user_goes_here');

define('_DB_PASSWD_', 'your_database_password_goes_here');

define('_DB_PREFIX_', 'ps_');

Tip: Also you may use browse button [...] to see the list of available databases and select the one you need from the drop-down.

Tip: Use the Test Connection button to verify if all settings are correct and connection to your remote database is possible.

4. Click 'OK' to save this entry, close Preferences and to connect to your database, or click cancel to discard this entry.

Also, you can use Database Connection wizard to setup your connection or make Database Backup/Restore using corresponding options.

If you're unable to connect to a remote database, here are few key items to check.

If you got "SQL ERROR: Access denied for user 'admin'@'' (using Password: YES)" notification (where 'admin' is your username and '' is your IP) you have to add your IP address to the Access List and allow direct MySQL connections. Please see an article to find out how to add your IP to the Access List.

2. Advanced Database Settings

Advanced Database Settings

Advanced Database Settings allow you to set up additional settings for your current database.

Write SQL log - You can use this checkbox in case if you need to see all SQL .log files which were created by Store Manager during its work.

Table prefix - You need to enter your database prefix for correct work of your Store Manager with the current database. You can click at Autodetect button and database prefix will be determined automatically.

By eMagicOne Inc.