MySQL install and load database on Inno Setup script

后端 未结 2 1658
一整个雨季
一整个雨季 2020-12-29 11:31

I have been reading through a lot of documents on Stack Overflow, you guys are great! I have taken some code that was suggested on another post. The help was great! I was ab

2条回答
  •  半阙折子戏
    2020-12-29 11:35

    After you installed MySQL and got it started, it´s easy to load an MySQL Script file.

    The keypoint is passing the command "source" to mysql.exe -e parameter, so it could load the script file. Passing script name with "<" signal didn´t work for me.

    [Files]
    Source: "script.sql"; DestDir: "{tmp}"; Flags: deleteafterinstall;
    
    [Run]
    Filename: "{reg:HKLM\SOFTWARE\MySQL AB\MySQL Server 5.6,Location}\bin\mysql.exe"; \
     Parameters: "-u root -prootpassword -e ""source {tmp}\script.sql"""; \
     StatusMsg: "Loading MySQL Database Initial Data"; \
     Flags: runhidden waituntilterminated;
    

提交回复
热议问题