Skip to content

Commit 5a637ff

Browse files
authored
Merge pull request #343 from nikspyratos/feature/passwordless-mariadb
Feat: Null password support for Mariadb
2 parents da50190 + e3c8437 commit 5a637ff

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/Services/MariaDb.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,24 @@ class MariaDb extends BaseService
1717
[
1818
'shortname' => 'root_password',
1919
'prompt' => 'What will the root password be?',
20-
'default' => 'password',
20+
'default' => '',
2121
],
2222
];
2323

2424
protected $dockerRunTemplate = '-p "${:port}":3306 \
2525
-e MYSQL_ROOT_PASSWORD="${:root_password}" \
26+
-e MYSQL_ALLOW_EMPTY_PASSWORD="${:allow_empty_password}" \
2627
-v "${:volume}":/var/lib/mysql \
2728
"${:organization}"/"${:image_name}":"${:tag}"';
2829

2930
protected static $displayName = 'MariaDB';
31+
32+
protected function buildParameters(): array
33+
{
34+
$parameters = parent::buildParameters();
35+
36+
$parameters["allow_empty_password"] = $parameters["root_password"] === "" ? "yes" : "no";
37+
38+
return $parameters;
39+
}
3040
}

0 commit comments

Comments
 (0)