Install MySQL Server if not present

Comments

1 comment

  • Avatar
    jesus

    Hi roomi,

    You can use the parameterString to ask for the username and password, and using a validationActionList to check the username and password provided with are correct. Find below how to achieve that:

    <parameterList>
        <parameterGroup>
            <name>mysql</name>
            <explanation></explanation>
            <value></value>
            <default></default>
            <parameterList>
                <stringParameter>
                    <name>username</name>
                    <description>Username</description>
                    <explanation></explanation>
                    <value></value>
                    <default></default>
                    <allowEmptyValue>0</allowEmptyValue>
                </stringParameter>
                <stringParameter>
                    <name>password</name>
                    <description>Password</description>
                    <explanation></explanation>
                    <value></value>
                    <default></default>
                    <allowEmptyValue>0</allowEmptyValue>
                </stringParameter>
                <stringParameter>
                    <name>host</name>
                    <description>Host</description>
                    <explanation></explanation>
                    <value></value>
                    <default></default>
                    <allowEmptyValue>0</allowEmptyValue>
                </stringParameter>
            </parameterList>
            <validationActionList>
                <runProgram>
                    <customErrorMessage>Cannot connect to MySQL Server</customErrorMessage>
                    <program>/path/to/mysql</program>
                    <programArguments>-h ${host} -u${root} -p${password} -e ";"</programArguments>
                </runProgram>
            </validationActionList>
        </parameterGroup>
    </parameterList>
    

Please sign in to leave a comment.