scripper2win
Posts: 3
Joined: Tue Jun 14, 2016 10:09 am

pack Mysql folder and start it as a service

Hi all,
I embedded MySQL database in folder with ini file into my installation package and would like to install it as a service.
The exe package has been successfully generated but during installation as an Administrator, the message pop up as follows.
"Service could not be configured. This could be a problem with the package or your permission. Verify that you have sufficient privileges to configure system services"

Does anyone know that it is the correct way to deal with it?
Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: pack Mysql folder and start it as a service

Hello and welcome to our forums,

Please take a look on our "How to install mysql server 5.0 and Connector silently" and "MySql server installation fails with MySQLInstallerConsole as custom action" forum threads which expose how the MySQL service can be installed and configured.

Let us know if this helped, otherwise please give us more details about your MySQL installation scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scripper2win
Posts: 3
Joined: Tue Jun 14, 2016 10:09 am

Re: pack Mysql folder and start it as a service

hi Dan,
thanks for your reply. I do not want to use cmd approach since it does not give your return status of your command so I am trying to use the service provided within advanced installer.
I used zip version of MySQL binary package win32 and packed it into my installer folder, added it as a service that supposed to be started during installation.
The MySQL service has been added on to Windows successfully during installation.
But MySQL failed to start with message saying "Service could not be configured. This could be a problem with the package or your permission. Verify that you have sufficient privileges to configure system services"

Code: Select all

(Action=AI_XmlConfig,ActionType=11265,Source=BinaryData,Target=**********,CustomActionData=**********)
MSI (s) (58:8C) [18:27:31:875]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIE986.tmp, Entrypoint: OnXmlConfig
MSI (s) (58:A0) [18:27:31:875]: Generating random cookie.
MSI (s) (58:A0) [18:27:31:875]: Created Custom Action Server with PID 8848 (0x2290).
MSI (s) (58:D0) [18:27:31:890]: Running as a service.
MSI (s) (58:D0) [18:27:31:890]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
MSI (s) (58:AC) [18:27:31:968]: Executing op: ActionStart(Name=InstallServices,Description=正在安装新服务,Template=服务: [2])
MSI (s) (58:AC) [18:27:31:968]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (58:AC) [18:27:31:968]: Executing op: ServiceInstall(Name=E5_MySQL,DisplayName=E5_MySQL,ImagePath="C:\Program Files (x86)\E5\mysql\bin\mysqld.exe" --install,ServiceType=288,StartType=2,ErrorControl=1,,Dependencies=[~],,,Password=**********,Description=E5_MySQL,,)
MSI (s) (58:AC) [18:27:31:968]: Executing op: ActionStart(Name=StartServices,Description=正在启动服务,Template=服务: [1])
MSI (s) (58:AC) [18:27:31:968]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (58:AC) [18:27:31:968]: Executing op: ServiceControl(,Name=E5_MySQL,Action=1,Wait=1,)
MSI (s) (58:78) [18:28:07:804]: I/O on thread 8732 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 3280 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 8324 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 1944 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 3856 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 8620 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 6096 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 7840 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 4040 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 5572 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 9100 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 6036 could not be cancelled. Error: 1168
MSI (s) (58:78) [18:28:07:804]: I/O on thread 6516 could not be cancelled. Error: 1168
MSI (s) (58:AC) [18:28:07:804]: 产品: E5 -- 错误 1920。启动服务 'E5_MySQL' (E5_MySQL) 失败。请确认您是否有足够的权限来启动系统服务。
Above is the excerpt from the log output. I also put on snapshot when creating my services.

Looking forward to your reply.
Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: pack Mysql folder and start it as a service

Hello,

I'm not sure why this happens, but please note that accordingly to the MySQL documentation the right way to install the MySQL as a service is to use "mysqld" tool.

If you want to install the MySQL as a service using the Windows Service tools, then you should first test if this approach works outside of the installation project. For instance, you can use the Windows SC.exe tool to install the MySQL service and make sure it works. If not, it is advised to create your own custom actions to install and remove the MySQL service. You can create your own custom action which will launch within its code the "mysqld" tool with the "--install" and "--remove" commands and check the exit code of the "mysqld" command.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”