MySQL

Connect your MySQL databases to Memex for AI-powered data analysis.

What is MySQL?

MySQL is one of the world's most popular open-source relational database management systems. It's widely used for web applications, data warehousing, and as a backend for countless applications. Once connected, Memex can query your MySQL databases, explore schemas, and help you analyze your data through natural conversation.

What You'll Need

Credential
Description
Example

Host

MySQL server hostname or IP

mysql.example.com or 127.0.0.1

Port

MySQL server port

3306 (default)

Database

Name of the database

myapp_production

Username

MySQL username

app_user

Password

MySQL password

Your secure password

Finding Your Credentials

For Cloud MySQL Services

Amazon RDS for MySQL:

  1. Log in to the AWS Console and go to RDS

  2. Select your MySQL instance

  3. Find the Endpoint (this is your host) and Port in the Connectivity section

  4. Use the master username or a dedicated user you've created

Google Cloud SQL:

  1. Go to the Cloud SQL instances page

  2. Select your instance

  3. Find the Public IP address or Private IP address for the host

  4. Use credentials created through the Users section

PlanetScale / Other Managed MySQL:

  • Check your provider's dashboard for connection details

  • Most providers show host, port, username, and password in a connection string format

For Self-Hosted MySQL

Contact your database administrator to obtain:

  • The server hostname or IP address

  • The port number (default is 3306)

  • The database name

  • A username and password with appropriate permissions

circle-info

For security, request a database user with read-only access. Avoid using the root account.

Connecting to Memex

  1. Open the Memex Hub from the sidebar

  2. Click on the Connectors tab

  3. Find and click the MySQL card

  4. Enter your Host, Port, Database, Username, and Password

  5. Give your connection a memorable name (e.g., "Production MySQL")

  6. Click Add Connection

Verifying Your Connection

Once connected, try asking Memex:

You should see a list of tables in your database.

Using Your Connection

Here are some examples of what you can ask:

Security Considerations

User Permissions

Create a dedicated read-only user for Memex:

circle-exclamation

Network Security

  • Ensure your MySQL server allows connections from external sources if needed

  • Use SSL/TLS connections when available

  • Configure firewall rules to restrict access to trusted IP addresses

  • For cloud databases, use private networking or VPC when possible

Password Security

  • Use strong, unique passwords for database accounts

  • Rotate passwords periodically

  • Never commit database credentials to version control

Troubleshooting

Connection Refused

  • Verify the hostname and port are correct

  • Check that MySQL is running (systemctl status mysql on Linux)

  • Ensure the MySQL server allows remote connections (check bind-address in my.cnf)

  • Verify firewall rules allow connections on port 3306

Access Denied

  • Double-check your username and password

  • Verify the user has access from your connection location (check the host part of the user, e.g., 'user'@'%' vs 'user'@'localhost')

  • Ensure the user has SELECT privileges on the database

  • Try connecting with a MySQL client to test credentials

Unknown Database

  • Verify the database name is spelled correctly

  • Ensure the database exists on the server

  • Check that the user has permission to access the database

SSL Connection Errors

  • If SSL is required, ensure your connection is configured for SSL

  • For some cloud providers, you may need to download and specify an SSL certificate

  • Check if the MySQL server requires SSL connections

Learn More

Last updated

Was this helpful?