MySQL
Connecting Your MySQL Database to Sequel
Welcome to Sequel! This guide will help you connect your MySQL database to Sequel, allowing you to run SQL queries using natural language and visualize results with charts and graphs.
Prerequisites
Before you begin, ensure you have the following:
- MySQL Database: Make sure your MySQL database is set up and running.
- Database Credentials: You will need the following details:
- Host URL or IP address
- Database name
- Username
- Password
- Port (default: 3306)
- Sequel Account: You must have a Sequel account. If you haven’t signed up yet, you can create an account at Sequel.
Step 1: Navigate to Database Connections
- On the Sequel dashboard, locate the menu on the left-hand side.
- Click on Database Connections to open the database management page.
Step 2: Add a New Connection
- In the Databases section, click the New Connection button.
- From the list of available database types, select MySQL.
Step 3: Enter Connection Details
You will now need to enter the required information to connect your MySQL database:
- Display Name: Give your connection a meaningful name (e.g., "Production Database" or "Analytics DB").
- Host: Enter the hostname/URL or IP address of your MySQL database server.
- Port: The default port for MySQL is
3306
. If your database uses a different port, specify that here. - Database Name: Enter the name of the MySQL database you want to connect to.
- Username: Provide the MySQL username with access to the database.
- Password: Enter the password for the MySQL user.
Optionally, you may also configure SSL settings or provide additional connection parameters if required by your MySQL setup.
Example of a MySQL Connection String
If you want to connect via a connection string, the format typically looks like this:
mysql://username:password@hostname:3306/databasename
Example:
mysql://root:password@192.168.1.100:3306/mydatabase
- Username:
root
- Password:
password
- Host:
192.168.1.100
(Replace with your server's IP address or hostname) - Port:
3306
(default port) - Database Name:
mydatabase
How to Get the Connection Parameters
-
Host: This is typically the IP address or domain name of the server where MySQL is hosted. You can get this from your server admin or hosting provider. For local databases, you can use
localhost
or127.0.0.1
. -
Port: The default MySQL port is
3306
. If your MySQL server is set up with a non-default port, you can find it in your MySQL configuration file (my.cnf
ormy.ini
). -
Database Name: This is the specific database you want to connect to. You can find the list of available databases by running the following command in the MySQL CLI:
SHOW DATABASES;
-
Username: This is the MySQL user that has permissions to access the specified database. You can manage users using the MySQL CLI:
SELECT user FROM mysql.user;
-
Password: The password associated with the MySQL user. Ensure that the user has appropriate privileges for the database you want to connect to.
Step 4: Test and Save the Connection
Click on the test and save connection button to validate the connection details and save the connection. After a successful test, Sequel will open the explorer view for your connected database. You can now ask your database questions or execute SQL queries.
Step 5: Query Your Database
Now that your MySQL database is connected, you can start querying it using natural language:
- Return to the Sequel dashboard.
- In the query input box, type a question or request, such as “Show me the list of users added last month” or “What is the average order value?”.
- Sequel will convert your request into an SQL query, execute it against your MySQL database, and display the results.
Step 6: Visualize Data with Charts and Graphs
Sequel allows you to create visualizations by simply asking it to visualize the data as a bar chart, line chart, or pie chart.
For example:
- Show me the user growth in the last 30 days in a line chart.
- Show me a bar graph of my top-selling products.
- Show me a pie chart of the top 10 organizations with the most users.
Troubleshooting
If you encounter any issues during the connection process:
- Connection Errors: Double-check your credentials and ensure your MySQL database is reachable from the internet (or from within your local network if using a private instance).
- Firewall/Network Issues: Ensure that your MySQL database server allows connections from Sequel's IP addresses or the IP address of your local machine (if using Sequel on-prem).
- SSL Configuration: If your MySQL server requires SSL, make sure the proper SSL certificates and settings are provided during connection setup.
Conclusion
That’s it! You’ve successfully connected your MySQL database to Sequel. Now you can leverage Sequel’s powerful natural language processing to query your database and generate insightful visualizations.
If you have any further questions or need additional help, feel free to reach out to our support team or consult the Sequel documentation.
Happy querying!
Additional Resources
On this page
- Connecting Your MySQL Database to Sequel
- Prerequisites
- Step 1: Navigate to Database Connections
- Step 2: Add a New Connection
- Step 3: Enter Connection Details
- Example of a MySQL Connection String
- How to Get the Connection Parameters
- Step 4: Test and Save the Connection
- Step 5: Query Your Database
- Step 6: Visualize Data with Charts and Graphs
- Troubleshooting
- Conclusion
- Additional Resources