diff --git a/packages/amplify-graphql-api-construct-tests/src/sql-datatabase-controller.ts b/packages/amplify-graphql-api-construct-tests/src/sql-datatabase-controller.ts index 61bb96dbf5..0e724b2464 100644 --- a/packages/amplify-graphql-api-construct-tests/src/sql-datatabase-controller.ts +++ b/packages/amplify-graphql-api-construct-tests/src/sql-datatabase-controller.ts @@ -260,6 +260,6 @@ export class SqlDatatabaseController { */ getConnectionUri = (engine: SqlEngine, username: string, password: string, hostname: string, port: number, dbName: string): string => { const protocol = engine === 'postgres' ? 'postgresql' : 'mysql'; - return `${protocol}://${username}:${password}@${hostname}:${port}/${dbName}`; + return `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${hostname}:${port}/${dbName}`; }; }