{"record":{"id":"888ee1f315eea6b5","repo":"anomalyco/sst","slug":"you-must-provide-the-password-to-connect-to-your-l-888ee1","errorCode":null,"errorMessage":"You must provide the password to connect to your locally running MySQL database either by setting the \"dev.password\" or by setting the top-level \"password\" property.","messagePattern":"You must provide the password to connect to your locally running MySQL database either by setting the \"dev\\.password\" or by setting the top-level \"password\" property\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/mysql.ts","lineNumber":605,"sourceCode":"      if (args.vpc instanceof Vpc) {\n        return {\n          subnets: args.vpc.privateSubnets,\n        };\n      }\n\n      // \"vpc\" is object\n      return output(args.vpc);\n    }\n\n    function registerDev() {\n      if (!args.dev) return undefined;\n\n      if (\n        $dev &&\n        args.dev.password === undefined &&\n        args.password === undefined\n      ) {\n        throw new VisibleError(\n          `You must provide the password to connect to your locally running MySQL database either by setting the \"dev.password\" or by setting the top-level \"password\" property.`,\n        );\n      }\n\n      const dev = {\n        enabled: $dev,\n        host: output(args.dev.host ?? \"localhost\"),\n        port: output(args.dev.port ?? 3306),\n        username: args.dev.username ? output(args.dev.username) : username,\n        password: output(args.dev.password ?? args.password ?? \"\"),\n        database: args.dev.database ? output(args.dev.database) : dbName,\n      };\n\n      new DevCommand(`${name}Dev`, {\n        dev: {\n          title: name,\n          autostart: true,\n          command: `sst print-and-not-quit`,","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/mysql.ts#L587-L623","documentation":"When running MySQL in dev mode (sst dev), SST needs a password to connect to the locally running database. If neither dev.password nor the top-level password property is set, it throws this VisibleError.","triggerScenarios":"Running `sst dev` with a MySql component that has dev mode enabled but both args.dev.password and args.password undefined.","commonSituations":"Adding a MySql component in dev mode and forgetting to set a local password; copying a prod config that relies on Secrets Manager into dev where no password exists.","solutions":["Set dev.password in the MySql component config","Or set the top-level password property on the component","Re-run `sst dev` after adding the password"],"exampleFix":"// before\nnew sst.aws.MySql(\"MyDb\", { dev: { partitions: 1 } });\n// after\nnew sst.aws.MySql(\"MyDb\", {\n  dev: { partitions: 1, password: \"localpassword\" }\n});","handlingStrategy":"validation","validationCode":"// Before enabling dev mode for MySql\nif (dev && args.dev?.password === undefined && args.password === undefined) {\n  throw new Error(\"Set dev.password or password for local MySQL\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set dev.password when configuring MySql dev mode","Keep a local dev password in .env (not committed) and feed it to the component","Document required dev settings in the project README","Test `sst dev` startup in CI smoke runs"],"tags":["mysql","dev-mode","password","local-development"],"backgroundTag":"missing-config-property","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}