PDA

View Full Version : MySql Script Error in Installshield



umairvb
08-01-2008, 11:51 PM
I use InstallShield 2009 BASIC MSI to install my own application which uses MySQL.

Actually i am running MySQL script in installshied 2009 SQL script view.

here i am getting error.

Error 27506 ERROR executing sql script [MySql][ODBC 3.51 Driver]
[mysql 5.1.25 vc community ,You have an error in your script check the manual the corresponds to your Mysql server version for the right sytax.


It is executing nicely in MySQL. But in installshield it is showing this error.

Here my some script like


DROP TABLE IF EXISTS `testingdb`.`tbl_adminpassword`;
CREATE TABLE `testingdb`.`tbl_adminpassword` (
`PK` int(10) unsigned NOT NULL AUTO_INCREMENT,
`AdminPassword` varchar(255) NOT NULL,
PRIMARY KEY (`PK`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `testingdb`.`tbl_department`;
CREATE TABLE `testingdb`.`tbl_department` (
`DepartmentPK` int(10) unsigned NOT NULL AUTO_INCREMENT,
`DepartmentName` varchar(150) NOT NULL,
PRIMARY KEY (`DepartmentPK`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


Please give me answer urgent because i will give setup to client.

hidenori
08-02-2008, 09:21 PM
Do you specify ; as the batch separator for your connection? The default batch separator is GO. You can change the setting in the Advanced tab.

umairvb
08-03-2008, 01:00 PM
Tkanks for reply hidenori
I specify ; batch operator in Advanced tab ,but again same error

Error 27506 ERROR executing sql script [MySql][ODBC 3.51 Driver]
[mysql 5.1.25 vc community ,You have an error in your script check the manual the corresponds to your Mysql server version for the right sytax.

what i am getting wrong,please help urgent

hidenori
08-05-2008, 11:25 AM
If you have inline comments (lines start with --) in your script, please remove them and see if it solves your issue. MySQL seems to support only block comments (/**/).

umairvb
08-11-2008, 03:06 PM
Thanks hidenori MySql Table create successfully but few problem remaining.

when execute stored procedure it give error

Error 27506 ERROR executing sql script [MySql][ODBC 3.51 Driver]
[mysql 5.1.25 vc community ,You have an error in your script check the manual the corresponds to your Mysql server version for the right sytax.


Here my stored Procedure


DELIMITER $$

DROP PROCEDURE IF EXISTS SP_DELETE_LOGO$$
CREATE PROCEDURE SP_DELETE_LOGO()
BEGIN

delete from tbl_logo;

END $$

DELIMITER ;


I am also remove DELIMITER but give same error.

My second problem is installshield not populate data

insert into tbl_adminpassword(AdminPassword) Values('admin');


Please Help urgent

hidenori
08-11-2008, 04:26 PM
You cannot use the DELIMITER command in InstallShield because it is a MySQL client command, not a SQL statement. What you can do is to use a different batch separator from ; and change your SQL script as follows:


DROP TABLE IF EXISTS `testingdb`.`tbl_adminpassword`;
/

CREATE TABLE `testingdb`.`tbl_adminpassword` (
`PK` int(10) unsigned NOT NULL AUTO_INCREMENT,
`AdminPassword` varchar(255) NOT NULL,
PRIMARY KEY (`PK`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/

DROP TABLE IF EXISTS `testingdb`.`tbl_department`;
/

CREATE TABLE `testingdb`.`tbl_department` (
`DepartmentPK` int(10) unsigned NOT NULL AUTO_INCREMENT,
`DepartmentName` varchar(150) NOT NULL,
PRIMARY KEY (`DepartmentPK`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/

DROP PROCEDURE IF EXISTS SP_DELETE_LOGO;
/

CREATE PROCEDURE SP_DELETE_LOGO()
BEGIN

delete from tbl_logo;

END
/

Note that you need to specify / in the Batch Separator setting on the Connection | Advanced tab

umairvb
08-15-2008, 03:01 PM
Thanks you for help me hidenori,the Tables ,Stored procedure create nicely ,but i want used Mysql server configuration setting in C#.Net like servername,userid and password for configuration purpose ,please tell me how to get values

hidenori
08-19-2008, 09:47 AM
You need to write a custom action to read the connection information from the registry, and set them to the Windows Installer properties associated with connection settings of InstallShield. You can find the names of the underlying Windows Installer properties in the Connection | Advanced tab of the SQL Scripts view.

Hope that helps.

hcl_60
07-18-2011, 02:19 AM
How to create a stored procedure and call the created stored procedure(via script) of MYSQL from installshiled.


thanks in advance..