Connect to MySQL
Securely connect your Hex workspace to your MySQL database.
- Users need the Admin workspace role to create a shared workspace data connection.
- Users need Can Edit or higher project permissions to create project data connections.
MySQL is one of the most popular open-source relational databases, designed primarily for transactional workloads powering web applications, content management systems, and e-commerce platforms. It's known for being fast, reliable, and straightforward to operate, with a massive ecosystem of tools and community support.
MySQL works best for accessing operational data in real-time or lightweight analytical needs. For Hex users with more intensive analytics workflows (e.g. complex queries, large aggregations), MySQL may yield slower performance.
How to get set up
- In Hex, go to Settings → Data sources.
- Click + Connection, select MySQL, and fill out the fields below.
Basic settings
- Name and Description - Set a display name and optional description to help identify your data connection.
- Host - The address of your MySQL database.
- Port - The port used for secure native connections to your MySQL database.
- Database - The name of the MySQL database you're connecting.
- Aurora cluster (optional) - Enable if connecting to an Aurora MySQL database cluster.
- Authentication type - Choose Password or Certificate and fill out the required fields.

Additional settings
The data connection form includes several optional sections:
- Advanced - Optional settings like custom SQL formatting, including schema data for AI, and connecting via SSH.
- Access - Optional data connection permissions.
- Schema browsing - Recommended settings like scheduling schema browser refreshes and schema filtering, both of which are recommended for performance and AI agent accuracy.
If you use a firewall to restrict database access, you'll need to add Hex's IP addresses to your allowlist.