In order to use MyQuery Builder remotely, you will need to create a Connection. If you're familiar with PHP data-driven development, you are familiar with PHP's need to create a connection to a MySQL database. The only difference between this remote connection and the one you would use to connect your app to your database is that in the need to punch through your firewall.
So before you create a Connection on MyQueryBuilder.com, you will need to do some prep work on your server first.
MyQuery Builder needs to see your data.
- Set Up a MySQL user in your database with restricted access to the IP range 70.32.68.%
- If behind a firewall you control:
- Open the MySQL database port (typically 3306) in your firewall. If possible, restrict access to 70.32.68.%
- Set up a port-forwarding rule to pass traffic through from the firewall to your MySQL server
- If on a shared hosting environment
- Grant access to the database from IP range 70.32.68.%
Step 1: Set Up a MySQL User With Restricted Access
You will need to create a MySQL user limiting access from MyQueryBuilder's server IP range to only those databases you wish to access with MyQuery Builder. There are any number of ways to do this including the following:
In terminal, enter the following:
mysql --user="root" --password="your_root_password"
CREATE USER 'new_username'@'70.32.68.%' IDENTIFIED BY 'password_for_new_username';
GRANT ALL ON some_database.* TO 'new_username'@'70.32.68.%';
Be sure to replace values above with your own appropriate passwords and table names.
Repeat line three above ("GRANT ALL") for each database you want this restricted user to access.
MySQL Workbench: User Setup
- Under Server Administration, open your server instance
- Under the Security Sidebar, open "Users and Privileges".
- Create a New Account, and enter the username and password credentials.
- In the "Limit Connectivity to Hosts Matching" field, enter 70.32.68.%, which is the IP range for our servers on Media Temple. It is a very good idea to limit connectivity to this IP range rather than using a wildcard. Note that "localhost" will not work because MyQueryBuilder.com is not local!
- Click on "Schema Privileges"
- Select the database(s) that you want to access with MyQuery Builder. It's a good practice to limit these databases only to those you'll need just to be safe. Please read the security note above regarding SSI and PII!
- Grant the appropriate access rights and click "Save Changes"
Step 2: Configure Your Firewall
If your database is on a development server behind a firewall that you control, open a port in your firewall for your MySQL database.
We are assuming you understand the security implications of this. Do not proceed if your database contains sensitive information. You will need to use our Locally Hosted option instead.
By default, MySQL runs on 3306.
If your firewall can be configured to do so, restrict access to the IP range 70.32.68.% to be safe.
You may need to set up a tunnel or a port-forwarding rule to the specific database server IP behind your firewall.
Step 3: Grant Access to Database
If your database is on a server in a shared hosting environment that allows external access, set up access restrictions.
Some hosts allow you to grant access to an IP range. If you host does, restrict the range to 70.32.68.%.
Step 4: Test your settings
Enter the credentials When setting up a connection on MyQueryBuilder.com, and click the "Test Connection" button.