We strongly recommend you use SSH or some other form of encryption to secure your data! If this is not an option, you can still directly connect MBI to your database using the instructions in this article.
In this article, we walk you through directly connecting your MySQL database to MBI. These settings can also be used with Commerce or any other eCommerce databases that use MySQL.
For the connection to be successful, your must configure your firewall to allow access from our IP addresses. They are
220.127.116.11, but it is also on the MySQL credentials page:
The simplest way to create a
MySQL user for MBI is to execute the following query when logged into
GRANT privileges. Replace
MBI IP Address with the MBI IP address and replace
secure password with a secure password of your choice:
GRANT SELECT ON *.* TO 'magentobi'@'<MBI IP address>' IDENTIFIED BY '<secure password>';
To restrict this user from accessing data in specific databases, tables, or columns, you can instead run
GRANT queries that only allow access to the data you permit.
Re-run the GRANT query for all required IPs using the same user and password.
To wrap things up, we need to enter the connection and user info into MBI. Did you leave the MySQL credentials page open? If not, go to Data > Connections and click Add New Data Source, then the MySQL icon. Do not forget to change the
Encrypted toggle to
Enter the following info into this page, starting with the
Database Connection section:
Connection Nickname: Enter a name for the integration (for example, Ecommerce Store)
Username: The username for the MBI MySQL user
Password: The password for the MBI MySQL user
Port: MySQL’s port on your server (
3306 by default)
Host: By default, this will be localhost. In general, it will be the bind-address value for your MySQL server, which by default is
127.0.0.1 (localhost), but could also be some local network address (for example,
192.168.0.1) or your server’s public IP address.
The value can be found in your
my.cnf file (usually located at
/etc/my.cnf) underneath the line that reads
\[mysqld\]. If the bind-address line is commented out in that file, your server is secured from outside connection attempts.
That is it! When you are finished, click Save & Test to complete the setup.