From 10c0d33ef3dbf36e2378c2ff0f29015f3e49dc13 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Thu, 17 Oct 2019 16:29:41 +0200 Subject: [PATCH] mariadb: Fix database initialization (#488) - Add notes about running as a service - Add info about default username/password --- bucket/mariadb.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bucket/mariadb.json b/bucket/mariadb.json index 3806b879b7..99c17d69b0 100644 --- a/bucket/mariadb.json +++ b/bucket/mariadb.json @@ -44,12 +44,19 @@ ], "persist": "data", "post_install": [ - "# Initialize data directory (without generating root password)", - "if (!(Test-Path \"$dir\\data\\auto.cnf\")) { mysqld --initialize-insecure }" + "if (!(Test-Path \"$dir\\data\\my.ini\") -and !(Test-Path \"$dir\\data\\my.cnf\") -and !(Test-Path \"$dir\\data\\mysql\")) {", + " warn 'Initializing data directory ...'", + " Invoke-ExternalCommand -FilePath \"$dir\\bin\\mysql_install_db.exe\" -ArgumentList @(\"--datadir=`\"$dir\\data`\"\")", + " warn 'Database has been initialized (username: root, password: )'", + "}" ], "notes": [ - "Run following command as administrator to run MariaDB as a service.", - "mysqld --install \"[Service Name(default:MySQL)]\"" + "Run 'mysqld --standalone' or 'mysqld --console' to start the Database,", + "or run following command as administrator to register MariaDB as a service. See: https://mariadb.com/kb/en/library/mysql_install_dbexe/", + "", + "mysql_install_db --service=MariaDB --password=NewRootPassword", + "", + "To stop and/or delete the Service run 'sc stop MariaDB' and 'sc delete MariaDB'." ], "checkver": { "url": "https://downloads.mariadb.org/",