4. Direct Connection to MySQL Database
This section describes how to setup direct connection to your MySQL server using Store Manager for PrestaShop.
Direct Connection - the type of connection that connects to the store’s database directly.
This is the fastest and the most convenient way to connect to a store.
- You will see everything you’ve changed in your online store instantly.
- There is the possibility to work with the store in groups up to 4 people without any conflicts with data.
- The direct connection to the database has to be permitted at a server. Some hosting companies forbid those types of connection, by default. In this case, you should consider the Bridge PHP connection.
- The speed of direct connection depends on the speed of your internet and server power.
- Import of a great amount of data to your store, for instance, 100 000 of products, will take more time with direct connection than with the Bridge connection.
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.
To configure direct connection to your remote database, follow few steps:
1. Open Tools -> Preferences -> Database Connection Tab (F12)
2. Select "Direct connection to remote database" check-box
3. Specify Remote Database Connection Settings
In order to find your settings, please follow few steps:
- Open your store using any FTP Client (like FileZilla, or any other)
- Open your store root directory via FTP and go to config directory
- Open settings.inc.php file and you will find your database server name (host), username and password
- Copy them to Store Manager
Remote Database Connection Settings fields:
- "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)
- define('_DB_SERVER_', 'localhost')
- "Port". 3306 is used in most cases (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:
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 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'@'188.8.131.52' (using Password: YES)" notification (where 'admin' is your username and '184.108.40.206' 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 allow you to set up additional settings for your current database.
"Write SQL log". You can select this checkbox 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 [Autodetect] button and database prefix will be determined automatically.