1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-10-01 08:44:09 +02:00

allow connecting to mysql db as root

This commit is contained in:
Robin Appelman 2021-06-14 18:03:50 +02:00
commit 8614a3e875
3 changed files with 18 additions and 7 deletions

View file

@ -209,7 +209,7 @@ impl Database {
Ok(Some(id))
}
pub async fn exec(&self, docker: &mut Docker, cloud_id: &str) -> Result<i64> {
pub async fn exec(&self, docker: &mut Docker, cloud_id: &str, root: bool) -> Result<i64> {
match self.family() {
DatabaseFamily::Sqlite => {
exec_tty(
@ -226,7 +226,13 @@ impl Database {
docker,
format!("{}-db", cloud_id),
"mysql",
vec!["mysql", "-u", "haze", "-phaze", "haze"],
vec![
"mysql",
"-u",
if root { "root" } else { "haze" },
"-phaze",
"haze",
],
vec![],
)
.await