anomalyco/sst · error · VisibleError
You must provide the password to connect to your locally run
Error message
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.
What it means
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.
Source
Thrown at platform/src/components/aws/mysql.ts:605
if (args.vpc instanceof Vpc) {
return {
subnets: args.vpc.privateSubnets,
};
}
// "vpc" is object
return output(args.vpc);
}
function registerDev() {
if (!args.dev) return undefined;
if (
$dev &&
args.dev.password === undefined &&
args.password === undefined
) {
throw new VisibleError(
`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.`,
);
}
const dev = {
enabled: $dev,
host: output(args.dev.host ?? "localhost"),
port: output(args.dev.port ?? 3306),
username: args.dev.username ? output(args.dev.username) : username,
password: output(args.dev.password ?? args.password ?? ""),
database: args.dev.database ? output(args.dev.database) : dbName,
};
new DevCommand(`${name}Dev`, {
dev: {
title: name,
autostart: true,
command: `sst print-and-not-quit`,View on GitHub (pinned to a0bd20f762)
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
Example fix
// before
new sst.aws.MySql("MyDb", { dev: { partitions: 1 } });
// after
new sst.aws.MySql("MyDb", {
dev: { partitions: 1, password: "localpassword" }
}); Defensive patterns
Strategy: validation
Validate before calling
// Before enabling dev mode for MySql
if (dev && args.dev?.password === undefined && args.password === undefined) {
throw new Error("Set dev.password or password for local MySQL");
} Prevention
- 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
When it happens
Trigger: Running `sst dev` with a MySql component that has dev mode enabled but both args.dev.password and args.password undefined.
Common situations: 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.
Related errors
- You must provide the password to connect to your locally run
- You must provide the password to connect to your locally run
- Failed to get password for MySQL ${name}.
- Storage must be at least 20 GB for the ${name} MySQL databas
- Storage cannot be greater than 65536 GB (64 TB) for the ${na
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/888ee1f315eea6b5.
Report an issue: GitHub.