[英]Want to create mysql user in installation with full Privileges In NSIS
I am using following code but did not succeed, please help 我正在使用以下代码,但未成功,请帮助
!define deflogin root
!define defpassword mysqlpassword
!define HOSTPORT "%"
ExecWait '$folder\bin\mysql --user=${deflogin} --password=${defpassword} --execute="grant all privileges on *.* to $\'${login}$\' @ $\'${HOSTPORT}$\' identified by $\'${password}$\'"'
${login}
& ${password}
taken by a custom .ini configuration by following process 自定义.ini配置通过以下过程获取${login}
和${password}
Function .onInit
InitPluginsDir
!insertmacro INSTALLOPTIONS_EXTRACT "database_details.ini"
!insertmacro INSTALLOPTIONS_WRITE "database_details.ini" "Field 2" "State" "${login}"
!insertmacro INSTALLOPTIONS_WRITE "database_details.ini" "Field 4" "State" "${password}"
FunctionEnd
ReadINIStr $login "$PLUGINSDIR\database_details.ini" "Field 2" "State"
ReadINIStr $password "$PLUGINSDIR\database_details.ini" "Field 4" "State"
Please tell where i am wrong. 请告诉我我错了。
Thanks @Seki for your reply. 感谢@Seki的回复。 This code is working fine i am confuse between ${password} and $password and ${login} and $login thats why its not woking now i am correct that code and it works. 这段代码可以正常工作,我在$ {password}和$ password以及$ {login}和$ login之间感到困惑,这就是为什么现在它不起作用的原因,我是正确的,它可以工作。
ExecWait '$folder\bin\mysql --user=${deflogin} --password=${defpassword} --execute="grant all privileges on *.* to $\'$login$\' @ $\'${HOSTPORT}$\' identified by $\'$password$\'"'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.