{
    "homepage": "https://dev.mysql.com/downloads/mysql/5.6.html",
    "description": "The world's most popular open-source database, supported by an active community.",
    "version": "5.6.51",
    "license": "GPL-2.0-only",
    "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/5.6/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'."
    ],
    "architecture": {
        "64bit": {
            "url": "https://dev.mysql.com/get/mysql-5.6.51-winx64.zip",
            "hash": "md5:bd4029698670ab42800dcdc409f78cad",
            "extract_dir": "mysql-5.6.51-winx64"
        },
        "32bit": {
            "url": "https://dev.mysql.com/get/mysql-5.6.51-win32.zip",
            "hash": "md5:e826653b8dc72ec41a6215d0be426052",
            "extract_dir": "mysql-5.6.51-win32"
        }
    },
    "bin": [
        "bin\\innochecksum.exe",
        "bin\\myisamchk.exe",
        "bin\\myisamlog.exe",
        "bin\\myisampack.exe",
        "bin\\myisam_ftdump.exe",
        "bin\\mysql.exe",
        "bin\\mysqladmin.exe",
        "bin\\mysqlbinlog.exe",
        "bin\\mysqlcheck.exe",
        "bin\\mysqld.exe",
        "bin\\mysqldump.exe",
        "bin\\mysqlimport.exe",
        "bin\\mysqlshow.exe",
        "bin\\mysqlslap.exe",
        "bin\\mysql_config_editor.exe",
        "bin\\mysql_tzinfo_to_sql.exe",
        "bin\\mysql_upgrade.exe",
        "bin\\my_print_defaults.exe"
    ],
    "persist": [
        "data",
        "my.ini"
    ],
    "pre_install": [
        "$ini = \"$dir\\my.ini\"",
        "if (!(Test-Path \"$ini\")) {",
        "   # Using $dir instead of $persist_dir, causes this error:",
        "   # [ERROR] [MY-010187] [Server] Could not open file '~/scoop/apps/mysql/current/data/host.err' for error logging: Permission denied",
        "   Add-Content -Path \"$ini\" -Value \"[mysqld]`ndatadir=$($persist_dir -replace '\\\\', '/')/data\" -Encoding Ascii",
        "   # Set username so it's not required when connecting",
        "   Add-Content -Path \"$ini\" -Value \"[client]`nuser=root\" -Encoding Ascii",
        "}"
    ],
    "post_install": "warn 'Database has been initialized (username: root, password: <blank>)'",
    "checkver": {
        "url": "https://dev.mysql.com/downloads/mysql/5.6.html",
        "regex": "<h1>MySQL Community Server ([\\d.]+)"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://dev.mysql.com/get/mysql-$version-winx64.zip",
                "extract_dir": "mysql-$version-winx64"
            },
            "32bit": {
                "url": "https://dev.mysql.com/get/mysql-$version-win32.zip",
                "extract_dir": "mysql-$version-win32"
            }
        },
        "hash": {
            "url": "https://dev.mysql.com/downloads/mysql/5.6.html",
            "regex": "(?sm)$basename.*?md5\">([A-Fa-f\\d]{32})"
        }
    }
}
