Skip to content

Commit

Permalink
fix(postgres,mysql): Fix database password not working
Browse files Browse the repository at this point in the history
  • Loading branch information
syfxlin committed Oct 27, 2024
1 parent 9338363 commit 4756644
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/mysql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class MysqlPlugin implements DepkerPlugin {
await this.exec([
`DROP USER IF EXISTS ${username}`,
`DROP DATABASE IF EXISTS ${database}`,
`CREATE USER '${username}'@'%' IDENTIFIED BY '${username}'`,
`CREATE USER '${username}'@'%' IDENTIFIED BY '${password}'`,
`CREATE DATABASE ${database}`,
`GRANT ALL PRIVILEGES ON ${database}.* TO '${username}'@'%'`,
`FLUSH PRIVILEGES`,
Expand Down
2 changes: 1 addition & 1 deletion src/core/postgres/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class PostgresPlugin implements DepkerPlugin {
await this.exec([
`DROP USER IF EXISTS ${username}`,
`DROP DATABASE IF EXISTS ${database}`,
`CREATE USER ${username} WITH PASSWORD '${username}'`,
`CREATE USER ${username} WITH ENCRYPTED PASSWORD '${password}'`,
`CREATE DATABASE ${database}`,
`GRANT ALL PRIVILEGES ON DATABASE ${database} TO ${username}`,
]);
Expand Down

0 comments on commit 4756644

Please sign in to comment.