{
  "manifest_version": "1",
  "slug": "mysql",
  "title": "MySQL",
  "headline": "Self-host MySQL",
  "description": "Run MySQL 9.7 LTS on an exe.dev VM: nightly tested backups, a private web admin, SSH tunnels, and connections from your apps and other VMs.",
  "category": "databases",
  "tags": [
    "mysql",
    "mysql 9.7",
    "database",
    "mysqldump",
    "backups",
    "adminer"
  ],
  "url": "https://exe.dev/deploy/mysql",
  "markdown_url": "https://exe.dev/deploy/mysql.md",
  "upstream": {
    "website": "https://www.mysql.com",
    "source": "https://github.com/mysql/mysql-server",
    "docs": "https://dev.mysql.com/doc/refman/9.7/en/",
    "license": "GPL-2.0"
  },
  "example_vm_name": "my-mysql",
  "time": "10 minutes",
  "stack": [
    {
      "name": "MySQL 9.7 LTS",
      "detail": "From Oracle's MySQL APT repository, sized for the VM",
      "port": 3306,
      "data": "/var/lib/mysql"
    },
    {
      "name": "Adminer 6",
      "detail": "Web admin, behind exe.dev login and an email allowlist",
      "port": 8000
    },
    {
      "name": "Nightly backups",
      "detail": "Every database and user, 14 nights kept",
      "data": "~/mysql/backups"
    }
  ],
  "access": [
    {
      "url": "https://my-mysql.exe.xyz/",
      "who": "private",
      "what": "Adminer, signed in as the MySQL admin user"
    }
  ],
  "delivers": [
    "MySQL 9.7 LTS, started at boot, listening on localhost only and sized for the VM's memory.",
    "An `app` database and user, with its connection settings in `~/mysql/app.env`.",
    "Adminer at the VM's private URL, open only to the owner's exe.dev email.",
    "Nightly backups of every database and user, one restored and checked."
  ],
  "owner_runs_after": [
    "ssh my-mysql.exe.xyz cat mysql/app.env",
    "ssh -N -L 3307:localhost:3306 my-mysql.exe.xyz"
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe.dev/new?prompt=Set%20up%20MySQL%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fmysql.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-mysql.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-mysql.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20MySQL%209.7%20LTS%2C%20started%20at%20boot%2C%20listening%20on%20localhost%20only%20and%20sized%20for%20the%20VM%27s%20memory.%0A-%20An%20%60app%60%20database%20and%20user%2C%20with%20its%20connection%20settings%20in%20%60~%2Fmysql%2Fapp.env%60.%0A-%20Adminer%20at%20the%20VM%27s%20private%20URL%2C%20open%20only%20to%20the%20owner%27s%20exe.dev%20email.%0A-%20Nightly%20backups%20of%20every%20database%20and%20user%2C%20one%20restored%20and%20checked.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20For%20initial%20setup%2C%0Afollow%20%22Install%20by%20hand%22%20from%20top%20to%20bottom%3A%20the%20MySQL%20repository%20and%0Aserver%2C%20the%20admin%20user%2C%20tuning%2C%20the%20app%20database%2C%20Adminer%20on%20port%208000%2C%0Athe%20backup%20timer%2C%20and%20the%20scratch-server%20restore%20test.%20The%20walkthrough%0Asections%20are%20for%20the%20owner%20afterwards%3A%20don%27t%20import%20data%2C%20set%20up%0ATailscale%20or%20Docker%20access%2C%20or%20run%20the%20Restore%20or%20Update%20instructions%0Aduring%20initial%20setup.%20Never%20overwrite%20an%20existing%20~%2Fmysql%2F%2A.env%20file.%0AAllow%20only%20the%20owner%27s%20email%20in%20Adminer%2C%20read%20from%20the%20reflection%0Aintegration%3B%20if%20that%20fails%2C%20ask%20the%20owner%20for%20it.%20Check%20Adminer%20on%0Alocalhost%20with%20no%20email%2C%20a%20wrong%20email%2C%20and%20the%20owner%27s%20email.%0ALeave%20the%20VM%20private%20and%20do%20not%20reboot.%20Don%27t%20paste%20passwords%20into%20the%0Achat%3B%20say%20they%20are%20in%20~%2Fmysql%2Fapp.env.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20ssh%20my-mysql.exe.xyz%20cat%20mysql%2Fapp.env%0A%20%20ssh%20-N%20-L%203307%3Alocalhost%3A3306%20my-mysql.exe.xyz%0A",
    "terminal": "curl -fsSL https://exe.dev/deploy/mysql/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "Set up MySQL on this VM by following the exe.dev recipe at https://exe.dev/deploy/mysql.md from top to bottom.\n\nThe recipe's example VM name is my-mysql. This VM's name is the output of `hostname`: use it wherever the recipe writes my-mysql. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- MySQL 9.7 LTS, started at boot, listening on localhost only and sized for the VM's memory.\n- An `app` database and user, with its connection settings in `~/mysql/app.env`.\n- Adminer at the VM's private URL, open only to the owner's exe.dev email.\n- Nightly backups of every database and user, one restored and checked.\n\nRead the whole recipe, including the closed details. For initial setup,\nfollow \"Install by hand\" from top to bottom: the MySQL repository and\nserver, the admin user, tuning, the app database, Adminer on port 8000,\nthe backup timer, and the scratch-server restore test. The walkthrough\nsections are for the owner afterwards: don't import data, set up\nTailscale or Docker access, or run the Restore or Update instructions\nduring initial setup. Never overwrite an existing ~/mysql/*.env file.\nAllow only the owner's email in Adminer, read from the reflection\nintegration; if that fails, ask the owner for it. Check Adminer on\nlocalhost with no email, a wrong email, and the owner's email.\nLeave the VM private and do not reboot. Don't paste passwords into the\nchat; say they are in ~/mysql/app.env.\n\nFinish with the URLs I should open and these commands, which only I can run, from my own computer (with this VM's name in them):\n  ssh my-mysql.exe.xyz cat mysql/app.env\n  ssh -N -L 3307:localhost:3306 my-mysql.exe.xyz\n",
    "prompt_url": "https://exe.dev/deploy/mysql/prompt.txt"
  },
  "updated": "2026-10-30",
  "verified": "2026-10-30",
  "related": [
    "postgres",
    "laravel",
    "django",
    "rails",
    "n8n-2",
    "claude-code"
  ]
}
