Tools: Update: MySQL on Heroku Is Complicated. Here Is What Actually Works in 2026

Tools: Update: MySQL on Heroku Is Complicated. Here Is What Actually Works in 2026

returns: mysql://username:password@hostname:port/default_schema Heroku does not support MySQL natively. If your app uses MySQL, you need a third-party add-on from the Heroku Elements Marketplace, and each option comes with its own pricing, limitations, and setup quirks. The same applies to MongoDB, SQLite, MariaDB, and most other databases. This is one of the most common surprises developers hit when moving from local development to a Heroku deployment. You build your app with MySQL, push to Heroku, and suddenly realise the platform you chose only supports PostgreSQL out of the box. You then spend an hour comparing JawsDB, ClearDB, and Stackhero before provisioning an add-on that may be deprecated next year. If you want to skip all of that, Kuberns is the faster path. It detects your database stack automatically and provisions MySQL, PostgreSQL, or MongoDB alongside your app in a single deploy. No add-on hunting, no manual connection string wiring, no fragmented billing. This guide covers every database option available on Heroku in 2026, what each one costs, how to set it up, where the add-on model breaks down, and what actually works better. Does Heroku support MySQL? Heroku does not include MySQL natively. To use MySQL on Heroku, you add a third-party add-on such as JawsDB MySQL or Stackhero for MySQL through the Heroku Elements Marketplace. These add-ons provision a managed MySQL database and inject the connection string as a JAWSDB_URL environment variable into your app automatically. What Databases Does Heroku Support Natively?

What databases does Heroku support natively Heroku natively supports exactly two database types out of the box. PostgreSQL via the Heroku Postgres add-on. This is the only relational database Heroku manages directly. Plans range from the Essential tier (starting at $5/month) up to Shield-tier plans for compliance-heavy applications. Setup is one command and the DATABASE_URL env var is injected automatically. Redis via the Heroku Key-Value Store add-on (formerly Heroku Redis). This covers caching, queues, and session storage. It follows the same one-click provisioning model as Postgres. Everything else requires either a third-party add-on from the Heroku marketplace or an external managed service you connect manually. Database Native on Heroku How to UsePostgreSQL Yes Heroku Postgres add-onRedis Yes Heroku Key-Value Store add-onMySQL No JawsDB, ClearDB, or Stackhero add-onMongoDB No MongoDB Atlas (external)MariaDB No JawsDB MariaDB planSQLite No Not supported in productionMSSQL No External Azure SQL or self-managedDynamoDB No AWS SDK + external connectionWant the full breakdown on what Heroku’s native databases actually cost? Here is everything you need: Heroku Postgres Plans and Pricing Explained Already using Redis on Heroku and wondering if you are overpaying? Read this first: Heroku Redis: Plans, Setup, and What It Costs How to Use MySQL on HerokuHow to use MySQL on Heroku There are three add-ons that work reliably for MySQL on Heroku in 2026. Here is what each one does and when to use it. JawsDB MySQLJawsDB is the most widely used MySQL add-on on Heroku. It provisions a fully managed MySQL or MariaDB database and injects the connection string as JAWSDB_URL into your app config automatically. Plans: Free Kitefin Shared plan (5MB limit, credit card required) up to Basking at $6,000/month for large enterprise deployments. Most production apps run on the Leopard ($10/month) or Blacktip ($24/month) shared plans. heroku addons:create jawsdbAccess the connection string: heroku config:get JAWSDB_URL const mysql = require('mysql2');const connection = mysql.createConnection(process.env.JAWSDB_URL);Connect in Python (SQLAlchemy): import osfrom sqlalchemy import create_engineengine = create_engine(os.environ['JAWSDB_URL'])JawsDB also supports MariaDB via a separate plan. Provisioning uses JAWSDB_MARIA_URL instead of JAWSDB_URL. ClearDB MySQLClearDB is an older MySQL add-on that still functions on Heroku but is less actively maintained than JawsDB. It injects CLEARDB_DATABASE_URL as the connection string. heroku addons:create cleardb:igniteheroku config:get CLEARDB_DATABASE_URLClearDB works for development and small projects. For anything production-grade, JawsDB or Stackhero is a better choice. Stackhero for MySQLStackhero provisions MySQL on a fully dedicated VM rather than a shared server. It includes TLS encryption, phpMyAdmin access, automatic daily backups, and one-click version upgrades. This is the right choice when you need isolation, compliance, or predictable performance. heroku addons:create ah-mysql-stackhero --app your-app-nameConfig vars injected: STACKHERO_MYSQL_HOST, STACKHERO_MYSQL_PORT, STACKHERO_MYSQL_ROOT_PASSWORD, STACKHERO_MYSQL_DATABASE_URL. JawsDB vs ClearDB vs StackheroJawsDB ClearDB StackheroFree plan Yes (5MB) Yes (5MB) NoShared or dedicated Both Shared only Dedicated onlyMariaDB support Yes No NophpMyAdmin No No YesTLS/SSL Yes Yes YesBest for Most use cases Dev/testing Production, complianceStarts at Free Free Paid plans onlyConfused by how Heroku add-on costs stack up against your dyno bill? This breaks it all down: Heroku Pricing Explained: What You Are Actually Paying in 2026 How to Connect MongoDB to a Heroku AppHow to connect MongoDB to a Heroku app Heroku no longer has an official MongoDB add-on. The last major option, mLab, was acquired by MongoDB and shut down in November 2020. Any tutorial you find referencing mLab is outdated. The current standard path is MongoDB Atlas, MongoDB’s own managed cloud database service. You create a cluster on Atlas, whitelist Heroku’s outbound IPs, and connect via a MONGODB_URI environment variable. Create a free cluster at cloud.mongodb.comUnder Network Access, add 0.0.0.0/0 to allow all IPs (Heroku uses dynamic IPs)Create a database user under Database AccessCopy the connection string from the Connect menuAdd it to your Heroku app:heroku config:set MONGODB_URI="mongodb+srv://username:[email protected]/dbname"In your app code:const mongoose = require('mongoose');mongoose.connect(process.env.MONGODB_URI);This works for MERN stack apps, Express APIs, and any Node.js app using Mongoose or the native MongoDB driver. Deploying a Node.js app on Heroku for the first time? Here is the exact step-by-step walkthrough: How to Deploy a Node.js App on Heroku in 2026 Tired of wiring up MongoDB manually every single time? Here is what developers are using instead: The Best Heroku Alternatives That Support Full-Stack Apps Kuberns Handles All of This Without Add-onsKuberns handles database deployment without add-ons The add-on model works, but it creates friction at every layer. You pick a database add-on separately from your app deployment. You get a separate bill for each add-on. The environment variable names differ between add-ons (JAWSDB_URL vs CLEARDB_DATABASE_URL vs MONGODB_URI), so swapping databases means code changes. When add-on providers change pricing or deprecate plans (as ClearDB and mLab both did), you migrate on their timeline, not yours. Kuberns removes this entirely. When you connect your GitHub repo and click Deploy, Kuberns reads your stack automatically. If your app uses MySQL, PostgreSQL, or MongoDB, it provisions the right database alongside your deployment in a single workflow. No marketplace, no separate billing, no manual env var wiring. What Kuberns does differently: Auto-detects your database type from your project dependenciesProvisions database and app together in one deployInjects connection credentials automatically as environment variablesScales your database with your app, no separate scaling stepsUnified billing across app and databaseFree credits to deploy your first project with no credit card requiredDeploy with KubernsOther Heroku Database Options: SQLite, MariaDB, MSSQL, DynamoDBSQLiteSQLite does not work on Heroku in production. Heroku uses an ephemeral filesystem that resets every time a dyno restarts or a new deploy runs. Any .db file written to disk is wiped. Your app will appear to work locally and then silently lose all data in production. Use Heroku Postgres for a free PostgreSQL option, or JawsDB for MySQL projects. Not sure why Heroku wipes your files on every restart? This explains exactly how Heroku works under the hood: What Is Heroku and How Does It Actually Work MariaDBJawsDB supports MariaDB natively through its MariaDB plan. Provisioning is the same process as MySQL but uses JAWSDB_MARIA_URL as the connection string variable. MariaDB is a drop-in replacement for MySQL, so most MySQL client libraries connect without code changes. MSSQL / SQL ServerThere is no official Microsoft SQL Server add-on on Heroku. If your app requires MSSQL, you connect to an external SQL Server instance, such as Azure SQL Database, via a standard connection string stored as a Heroku config var. heroku config:set DATABASE_URL="Server=your-server.database.windows.net;Database=yourdb;User Id=youruser;Password=yourpassword;"DynamoDBDynamoDB is an AWS-native service. You connect to it from a Heroku app using the AWS SDK and environment variables for your credentials and region. heroku config:set AWS_ACCESS_KEY_ID=your-keyheroku config:set AWS_SECRET_ACCESS_KEY=your-secretheroku config:set AWS_REGION=ap-south-1DynamoDB works from Heroku but adds latency if your Heroku app runs in a different region from your DynamoDB table. Quick ReferenceDatabase Heroku Support Recommended ApproachSQLite Not supported Use Heroku Postgres insteadMariaDB Via JawsDB MariaDB plan heroku addons:create jawsdb (MariaDB plan)MSSQL External only Azure SQL + connection string config varDynamoDB External only AWS SDK + AWS_ACCESS_KEY_ID config varsNoSQL (general) Redis native, MongoDB external Atlas for MongoDB, Key-Value Store for RedisHeroku vs Kuberns: Database Management ComparedHeroku KubernsPostgreSQL Native Heroku Postgres add-on Auto-provisioned with deploymentMySQL JawsDB, ClearDB, or Stackhero add-on Auto-detected, provisioned with appMongoDB External Atlas setup (manual) Auto-detected, provisioned with appMariaDB JawsDB MariaDB plan Auto-detectedSQLite Not supported Persistent DB provisioned insteadAdd-on billing Separate per add-on Unified with appEnv var setup Manual per add-on Injected automaticallyDB and app in one deploy No YesMigrate when add-on deprecated Your problem Not applicableAWS cost savings None Up to 40%The core difference is workflow. On Heroku you deploy your app, then provision a database, then wire the two together manually. On Kuberns the entire stack goes live together. Wondering what you are really paying for with Heroku hosting? This is the honest breakdown: Heroku Hosting Explained: What It Is, How It Works and Alternatives Is your Heroku GitHub integration broken or slow? Here is why it keeps failing and what to use instead: Heroku GitHub Integration: Why It Breaks and What to Do ConclusionIf you are already on Heroku and your app needs MySQL, JawsDB is the most reliable path in 2026. For MongoDB, MongoDB Atlas connected via MONGODB_URI is the only officially supported option since mLab was shut down. Skip SQLite entirely for any Heroku deployment. If you are starting a new project or tired of managing database add-ons separately from your app, Kuberns removes that entire layer. Your database, your app, your SSL certificate, and your deployment pipeline all come up together in a single workflow. Start deploying for free on Kuberns Templates let you quickly answer FAQs or store snippets for re-use. as well , this person and/or