๐Ÿš€Early Access: Lifetime deal โ€” $69 for 2 data source connections. Sign up free to try firstโ†’

Back to Blog

How to Connect Claude to MySQL

Step-by-step guide to connecting Claude Desktop to your MySQL database using a managed MCP server. No local setup, no config files โ€” just one URL.

MySQL powers more databases than almost anything else on the internet โ€” WordPress sites, e-commerce stores, SaaS backends, internal tools. If your data lives in MySQL, this guide shows you how to connect Claude to it so you can query it in plain English. (New to MCP? See What is an MCP Server?)

What You'll Need

  • A MySQL database (local, AWS RDS, PlanetScale, Railway, DigitalOcean, or any hosted MySQL)
  • Claude Desktop or Claude.ai with connector support
  • A Synra account (free to start)

Why Not Just Use a Local MCP Server?

You can run a local MySQL MCP server โ€” there are open source options on GitHub. But local means:

  • Separate setup on every machine you use
  • Connection string and password stored in a plaintext .env file
  • No audit trail of what queries were run
  • No read-only enforcement at the gateway level

A managed MCP gateway like Synra handles all of that centrally. One URL, encrypted credentials, read-only by default, every query logged.

Step-by-Step: Connect MySQL to Claude via Synra

Step 1 โ€” Get your MySQL credentials

You'll need:

  • Host โ€” e.g. mysql.example.com or your-db.us-east-1.rds.amazonaws.com
  • Port โ€” usually 3306
  • Database name
  • Username and password

If you're on Railway or PlanetScale, copy the connection string from your project dashboard โ€” Synra can parse it directly.

Step 2 โ€” Save credentials in Synra

  1. Sign up at mcpserver.design
  2. Go to Credentials โ†’ Add Database
  3. Select MySQL from the dropdown
  4. Enter your connection details and save

Synra encrypts your credentials with AES-256 immediately on save. It also tests the connection so you know it works before you leave the page.

Step 3 โ€” Copy your MCP endpoint URL

Once connected, Synra generates a unique MCP endpoint URL for your database. Find it in the Endpoints tab of your dashboard and copy it.

Step 4 โ€” Add to Claude

Open Claude โ†’ Settings โ†’ Connectors โ†’ Add custom connector โ†’ paste your Synra URL.

That's it. Claude will detect the available tools and show a database icon in the toolbar confirming the connection is live.

What Can Claude Do With Your MySQL Database?

Once connected, Claude can:

  • List all tables and their schemas
  • Run SELECT queries based on your plain English questions
  • Join tables and aggregate data
  • Describe column types and relationships
  • Help you understand your own data structure

All queries are read-only. Synra blocks INSERT, UPDATE, DELETE, DROP, ALTER, and TRUNCATE at the gateway level โ€” there's no way for Claude to modify your data.

Example Queries to Try

Once connected, ask Claude things like:

  • "How many new users signed up this week?"
  • "What are my top 10 products by revenue this month?"
  • "Show me all orders with a status of 'pending' older than 7 days."
  • "What tables are in my database and how are they related?"

Claude will write the SQL, run it, and return the results in a readable format โ€” no SQL knowledge required on your end.

Troubleshooting Common Issues

Connection refused โ€” Check that your MySQL host allows connections from external IPs. For RDS, check your security group inbound rules. For local databases, you'll need to expose them via a tunnel.

Access denied โ€” Make sure the username has SELECT privileges on the database. You don't need (and shouldn't give) write access.

SSL errors โ€” Synra supports SSL connections. If your MySQL requires SSL, enable it in the connection settings.


Ready to try it? Connect your MySQL database to Claude โ€” free to start, setup takes under 60 seconds.

Related guides: