mysql script problem - 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!

grobin67
Posts: 15
Joined: Thu Nov 04, 2010 12:30 pm

mysql script problem

My installation script needs to connect to a MySQL database and run an installation script to setup a schema. I have the MySQL dialog coming up fine and initially that was working ok to verify the connection and create the database. Then I added the scripting by adding a new script under the database connection in SQL Scripts. The problem now is when I run my installer I am getting an error "ODBC Connect: timeout exceeded".

I have setup installation of the MySQL ODBC drivers for Windows as pre-requisites, what I am not clear on though is exactly what I should now put in as an ODBC Driver and Data Source. If go to add a Data Source shouldn't I see the ODBC MySQL drivers as an option?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: mysql script problem

Hi,
what I am not clear on though is exactly what I should now put in as an ODBC Driver and Data Source.
Since you are installing the ODBC driver as a prerequisite, you should specify the driver name. If it's already installed on your machine you should be able to select it in "ODBC Driver" combo box.
If go to add a Data Source shouldn't I see the ODBC MySQL drivers as an option?
Advanced Installer shows only the drivers found on your machine. If the driver is not installed, you need to specify its name manually.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
grobin67
Posts: 15
Joined: Thu Nov 04, 2010 12:30 pm

Re: mysql script problem

Ah ok I understand this better now, but I still not sure of the best approach. My application is not going to install or configure MySQL that would be a requirement of installation that this done, it simply needs to connect to the database and run the initialisation script. That being the case, what is the best approach? Do I need to include the ODBC drivers as pre-requisites or with the fact MySQL will be installed can something be asked of the user to pick?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: mysql script problem

Hello,
Do I need to include the ODBC drivers as pre-requisites or with the fact MySQL will be installed can something be asked of the user to pick?
Since you mentioned you can't see the driver in the combobox and MySql is installed on that machine, means that the driver is not installed although MySQL is. You can try to include the driver name in the string without adding it as a prerequisite just to make sure.

Here is the article that has the steps to configure a MySQL server connection.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
grobin67
Posts: 15
Joined: Thu Nov 04, 2010 12:30 pm

Re: mysql script problem

Sorry still very confused by this process, maybe clarifying what I am trying to setup will help.

My installer needs to deploy a Java app as part of a Tomcat installation, so it has pre-requisites for JRE and Tomcat and then places the .jar in the correct location. The next thing it needs to do is provide the ability to create a database and apply a schema the app will use. The app itself does not use ODBC but JDBC via another .jar that is installed.

So I have created a MySQL dialog page and I have added the MySQL ODBC Driver as a pre-requisite and I see this is a selection option in the Database Server SQL Connection page.

However your tutorial then talks about adding the DLL for the ODBC connection into the Resources Files/Folders, but this DLL is NOT used by my application so where would I put it and where do I find it? I thought the whole point of Resources are files that you need to install?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: mysql script problem

Hi,

The tutorial, as my colleague Cosmin mentioned, explains two scenarios:
1. Driver is already installed on target machine => choose its name from the "ODBC Driver" editable combo box
2. Driver is not installed on target machine => hard-code its name into the "ODBC Driver" editable combo box with two possibilities : If you included the driver as a prerequisite as you mentioned, simply hard code its name in the "ODBC Driver" editable combo box.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
grobin67
Posts: 15
Joined: Thu Nov 04, 2010 12:30 pm

Re: mysql script problem

Ok I tried that, and I am getting the following error (this is on a netbook running Windows XP):

"Error configuring ODBC data source: MySQL Data Source, ODBC error 6: Component not found in the registry. Verify that file MySQL Data Source Exists and that you can access it".

This is what I did:

1. Prerequisites: I have MySQL ODBC Driver added (mysql-connector-odbc-5.1.8-win32.msi), set to install on 64-bit, 32-bit and Windows 9x versions with "Force installation of this prerequisite" checked.

2. ODBC: I created a Data Source called "MySQL Data Source", and typed in the name "MySQL ODBC Driver" as named in 1 above.
3. SQL Scripts: I have a database connection added as follows:

Connection Type: MySQL Server
Connection Mode: ODBC Data Source
ODBC Data Source: MySQL Data Source

Any ideas?
grobin67
Posts: 15
Joined: Thu Nov 04, 2010 12:30 pm

Re: mysql script problem

Can anyone help with this? Happy to send in the installer files if need be.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: mysql script problem

Hi,

An SQL Connection cannot use a data source installed by the same package. The data source or ODBC driver needs to be already installed when starting the installation.

A solution is to use the ODBC driver directly without a data source. Another solution is to create a separate package which installs the data source. This package can then be added as a prerequisite to your main installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”