mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-04 15:51:23 +00:00
mysql: Fix database initialization (#489)
- Add notes about running as a service - Add info about default username/password
This commit is contained in:
parent
435004ba74
commit
7bfacbf76c
@ -39,23 +39,35 @@
|
|||||||
"bin/perror.exe",
|
"bin/perror.exe",
|
||||||
"bin/zlib_decompress.exe"
|
"bin/zlib_decompress.exe"
|
||||||
],
|
],
|
||||||
"persist": "data",
|
"persist": [
|
||||||
"post_install": [
|
"data",
|
||||||
"if (!(Test-Path \"$dir/my.ini\")) {",
|
"my.ini"
|
||||||
|
],
|
||||||
|
"pre_install": [
|
||||||
|
"$ini = \"$dir\\my.ini\"",
|
||||||
|
"if (!(Test-Path \"$ini\")) {",
|
||||||
" # Using $dir instead of $persist_dir, causes this error:",
|
" # Using $dir instead of $persist_dir, causes this error:",
|
||||||
" # [ERROR] [MY-010187] [Server] Could not open file 'C:/Users/ex/scoop/apps/mysql/current/data/host.err' for error logging: Permission denied",
|
" # [ERROR] [MY-010187] [Server] Could not open file '~/scoop/apps/mysql/current/data/host.err' for error logging: Permission denied",
|
||||||
" $dir_u = ($persist_dir -replace '\\\\', '/')",
|
" Add-Content -Path \"$ini\" -Value \"[mysqld]`ndatadir=$($persist_dir -replace '\\\\', '/')/data\" -Encoding Ascii",
|
||||||
" Add-Content \"$dir/my.ini\" '[mysqld]' -Encoding Ascii",
|
|
||||||
" Add-Content \"$dir/my.ini\" \"datadir=$dir_u/data\" -Encoding Ascii",
|
|
||||||
" # Set username so it's not required when connecting",
|
" # Set username so it's not required when connecting",
|
||||||
" Add-Content \"$dir/my.ini\" '[client]' -Encoding Ascii",
|
" Add-Content -Path \"$ini\" -Value \"[client]`nuser=root\" -Encoding Ascii",
|
||||||
" Add-Content \"$dir/my.ini\" 'user=root' -Encoding Ascii",
|
|
||||||
"}",
|
|
||||||
"if (!(Test-Path \"$dir/data\\auto.cnf\")) {",
|
|
||||||
" # Initialize data directory (without generating root password)",
|
|
||||||
" mysqld.exe --initialize-insecure",
|
|
||||||
"}"
|
"}"
|
||||||
],
|
],
|
||||||
|
"post_install": [
|
||||||
|
"if (!(Test-Path \"$dir\\data\\auto.cnf\")) {",
|
||||||
|
" warn 'Initializing data directory ...'",
|
||||||
|
" Invoke-ExternalCommand -FilePath \"$dir\\bin\\mysqld.exe\" -ArgumentList '--initialize-insecure'",
|
||||||
|
" warn 'Database has been initialized (username: root, password: <blank>)'",
|
||||||
|
"}"
|
||||||
|
],
|
||||||
|
"notes": [
|
||||||
|
"Run 'mysqld --standalone' or 'mysqld --console' to start the Database,",
|
||||||
|
"or run following command as administrator to register MySQL as a service. See: https://dev.mysql.com/doc/refman/en/windows-start-service.html",
|
||||||
|
"",
|
||||||
|
"mysqld --install MySQL --defaults-file=\"$dir\\my.ini\"",
|
||||||
|
"",
|
||||||
|
"To stop and/or delete the Service run 'sc stop MySQL' and 'sc delete MySQL'."
|
||||||
|
],
|
||||||
"checkver": {
|
"checkver": {
|
||||||
"url": "https://dev.mysql.com/downloads/mysql/",
|
"url": "https://dev.mysql.com/downloads/mysql/",
|
||||||
"re": "<h1>MySQL Community Server ([\\d.]+)"
|
"re": "<h1>MySQL Community Server ([\\d.]+)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user