MYSql script does not work on with visual studio project - Advanced Installer Community
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

MYSql script does not work on with visual studio project

Hi Everyone,

I have a problem with creating setup project for my visual studio project. I ll try to explain wih detail on below;

I have a visual studio which i used mySQL database. I finished my project and i want to create a setup. My Setup project should do these;
- Installing my program
- installing Mysql server
- create databases with tables and stored procedure.

When i try to install setup to another computer, i have some problems;
Database does not installing and does not give any error.

can some one help me about that case plz?

here is attachments, which are database connection parameters which i used on my setup projects
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MYSql script does not work on with visual studio project

Hello and welcome to our forums,

I'm afraid I didn't find any attachment to this thread. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

Also, please take a look on our "How to install mysql server 5.0 and Connector silently" thread which could be useful for your setup project configuration.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

Re: MYSql script does not work on with visual studio project

Thank you for your reply. here is my project on attachment.

i have tried to install many times from this morning with setup project several times.

program does not give any error message but does not create database and tables.
Hali Maliyet Arge.aip
(41.3 KiB) Downloaded 651 times
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

Re: MYSql script does not work on with visual studio project

I found problem finally but i dont know how i can solve without change my script.

I have some turkish characters on my database data (not table or field just data),

when i try to install from my setup, it create database, and creating tables with values. but in my one table there are some turkish characters,

ID Definition
1 Atkı ...... something going on
2 Atkı ........ something different

but as i see advanced installer delete characters here turkish character start. it comes like that
ID Definition
1 Atk
2 Atk

and definition is unique field, so it can not insert my datas and exiting from setup.

finally i should find a way that advanced installer should not change anything from my script.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MYSql script does not work on with visual studio project

Hello,

Thank you for your feedback.

This is strange. Can you try to manually run the related script on your MySQL server and see if run successfully?

Also, could you try to isolate the issue in a small buildable sample (AIP + its referenced resources) and send it us to support at advancedinstaller dot com alongside a short test case we can follow to replicate the error? If you cannot replicate the error in a small sample could you send us a download link to your setup package so we can test and investigate it on our side? Also, please make sure you send the same version of your AIp (project file) as the one used to build the setup which fails.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

Re: MYSql script does not work on with visual studio project

Hello Daniel,

first of all, thank you being interest with my problem. i tested mysql script manually on computer before i created post in here. there is no problem manually import mysql script. I solved the problem but its really not good solution for me.
1-i created just database.
2-i execute a batch file which i prepared to import database to mysql DB (it import from .sql file)

its worked but its not a good idea for me cuz i had to add mysql back up script to application folder. actually i dont want to let user see my sql script in a folder.

here i attached the project which not worked. I i add there part of my script.
Attachments
Hali Maliyet Arge.aip
(48.78 KiB) Downloaded 475 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MYSql script does not work on with visual studio project

Hello,

Thank you for your follow up.

After further reviewing your setup settings its seems you are using an ANSI ODBC driver for your SQL connection added in our "SQL Databases" page. And most likely this is the source of your issue. Can you please go to "SQL Databases" page, select your SQL connection and in the "ODBC Driver" field set a MySQL ODBC 5.3 Unicode Driver? The unicode driver should be able to correctly parse your SQL Script.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

Re: MYSql script does not work on with visual studio project

Thank you for ur advice. now some part of mysql script is works. this is really weird , its creating tables now but it does not create stored procedure :)

here is the 2 SP which i used. normally if u run that script on mysql manually it works but with setup there is giving syntax error.

NOTE : u can add that script to my project which i sent you before.

DROP PROCEDURE IF EXISTS `spc_kullanici_sifre_guncelle`;
DELIMITER |
CREATE PROCEDURE `spc_kullanici_sifre_guncelle`(
in p_rid int,
in p_eski_sifre varchar(50),
in p_yeni_sifre varchar(50),
in p_kullanici_adi varchar(50),
out sonuc int,
out sonuc_mesaj varchar(500))
BEGIN
set sonuc = 0;
if exists(select 1 from kullanicilar where sifre=p_eski_sifre and rid=p_rid) then
update kullanicilar set sifre=p_yeni_sifre where rid=p_rid;
set sonuc = 1;
set sonuc_mesaj ="";
else
set sonuc=0;
set sonuc_mesaj ="Girdiğiniz eski şifre yanlış. Lütfen kontrol ediniz!";
#return sonuc; eger kullanici log kullanilacak olursa kullanilacak
end if;
END |
DELIMITER ;

DROP PROCEDURE IF EXISTS `spc_kullanici_tema_kayit`;
DELIMITER |
CREATE PROCEDURE `spc_kullanici_tema_kayit`(
in p_kullanici_rid int,
in p_icerik varchar(50)
)
BEGIN
IF EXISTS(SELECT 1 FROM kullanici_tema WHERE kullanici_rid = p_kullanici_rid) then
update kullanici_tema set icerik=p_icerik, tarih=now() where kullanici_rid=p_kullanici_rid;
else
insert into kullanici_tema(kullanici_rid, icerik, tarih) values(p_kullanici_rid, p_icerik, now());
end if;
END |
DELIMITER ;
sineater
Posts: 7
Joined: Thu Mar 02, 2017 3:43 pm

Re: MYSql script does not work on with visual studio project

Thank you for helps.

I solved the problem like that;

i created 2 script. first for tables and database and second one for stored procedures.

and i removed ";" from "statement separator". and rebuild project. now its working. :D
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MYSql script does not work on with visual studio project

Thank you for your follow up. I'm glad you got this working.

Indeed, when you redefine the MySql delimiter inside your script content you should not set our "Statement separator" field. Otherwise your script content will be parsed using the specified separator and it will be wrongly truncated and executed.

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

Return to “Building Installers”