unable to run sql script after installing/starting service - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

aunghtain
Posts: 2
Joined: Tue Mar 29, 2011 6:52 pm

unable to run sql script after installing/starting service

Hi,
I'm new to AI. I'm trying to install MySQL as part of my installer, but having some issue. Here's what I have done so far.
1) I included mysql installation files along with my install files.
2) I added custom actions - install MySQL service and start MySQL service. [ I followed a thread found on this forum. ]
3) I moved these custom actions to RegisterFonts component.
4) I added ODBC driver, added connection and added MySQL script to run.

The error I'm getting is [SQLDriverConnect] {SQL_STATE:HY000}[MySQL][ODBC 5.1 Driver] Can't connect to MySQL server on 'localhost' (10061).

I verified that MySQL service was installed and running when I got this error (through a command line mysql.exe -u root mysql)

I have also checked my connection settings by doing the following.
1) First, I installed MySQL (using MySQL msi)
2) I created another project which just connects to MySQL and run SQL script. It works.

So I think that my ODBC driver, connection settings are correct. But there must be some synchronization issue. (like the service is not running yet when AI tries to connect.)

I can send my .aip. Please let me know. Thanks in advance!
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: unable to run sql script after installing/starting service

Hi and welcome to our forums,
I have also checked my connection settings by doing the following.
1) First, I installed MySQL (using MySQL msi)
2) I created another project which just connects to MySQL and run SQL script. It works.
This is the correct method, you just need to make a small change, i.e to add the MSI which install MySQL as a prerequisite in the setup project of your application,
as explained in this tutorial. and then set the prerequisite as global from Options tab.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aunghtain
Posts: 2
Joined: Tue Mar 29, 2011 6:52 pm

Re: unable to run sql script after installing/starting service

Thanks for the reply. I have tried your suggestion.

1) I added MySQL msi as prerequisite and set it to Global. I also added /quiet in command line so that it's installed without UI.

But, I assume that by adding MySQL msi as prerequisite, I should not include MySQL installation files in "Files and Folders". Then, how do I create custom action scripts to install service and start service? I do not have mysqld-nt.exe in "Files and Folders" anymore.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: unable to run sql script after installing/starting service

Hi,

If the service is part of the MySql installer package it should be automatically installed and started along with the MySql prerequisite installer. However, if this is not the case you can include only the .EXE in the Files and Folders Page and configure the service install and start from the Services Page.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”