This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: running mysql command line client from batch file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 17, 2009
06:49 AM
running mysql command line client from batch file
Hi,
I m new to this InstallAnywhere 2009.
I have tried to run mysql command line client from a batch file.
the batch contains the following code
mysql --user=root --password=root mysql < mysql_db.sql
if i excuete this script(batch) file seperately it is launching mysql command line client and copies the sql file content to the databse.
But when i set it as Target file(Execute Target file) or paste it as a Script (Execute script/batch file)in the InstallAnywhere it is not launching the mysql client and installer is also hanging.
i want to dispaly mysql command line client in postInstall.
please correct me if im not going in a correct way.
I m new to this InstallAnywhere 2009.
I have tried to run mysql command line client from a batch file.
the batch contains the following code
mysql --user=root --password=root mysql < mysql_db.sql
if i excuete this script(batch) file seperately it is launching mysql command line client and copies the sql file content to the databse.
But when i set it as Target file(Execute Target file) or paste it as a Script (Execute script/batch file)in the InstallAnywhere it is not launching the mysql client and installer is also hanging.
i want to dispaly mysql command line client in postInstall.
please correct me if im not going in a correct way.
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 17, 2009
07:32 AM
Would it be possible for you to post your project?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2009
04:15 AM
Hi Sangeetha,
I can tell you how I do this. I launch a batch file from my installer with the "Execute command" action and I use "C:\apoyo.bat" as my command line. In that file I have something like this
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe" -u root --password=root < "C.\apoyo.sql"
Maybe the problem you have is because you don't specify the path to the mysql executable.
Hope this helps.
Regards
Alberto E.
I can tell you how I do this. I launch a batch file from my installer with the "Execute command" action and I use "C:\apoyo.bat" as my command line. In that file I have something like this
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe" -u root --password=root < "C.\apoyo.sql"
Maybe the problem you have is because you don't specify the path to the mysql executable.
Hope this helps.
Regards
Alberto E.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2009
04:49 AM
Hi Albert,
Thanks for your reply.
I tried by giving the sql path also.It is not working for me.
I m very much confused ,now i wrote a custom code also.
As a seperate jar it is inserting values in DB tables,
But when try to execute it in InstallAnywhere it is not working,
I have complete ths sql connection by asap
pls help me if anybody knows
Thanks for your reply.
I tried by giving the sql path also.It is not working for me.
I m very much confused ,now i wrote a custom code also.
As a seperate jar it is inserting values in DB tables,
But when try to execute it in InstallAnywhere it is not working,
I have complete ths sql connection by asap
pls help me if anybody knows
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2009
05:23 AM
Hi again Sangeetha,
Actually, if you are trying to run a MySQL script with the Enterprise edition of IA '09, you can include a database server in the Organization -> Hosts tab. You then configure the connection data and in the Install tab you will be able of adding a new kind of action, the "Run SQL Script" where you can include your SQL script.
Can you try if this helps you?
Regards
Alberto E.
Actually, if you are trying to run a MySQL script with the Enterprise edition of IA '09, you can include a database server in the Organization -> Hosts tab. You then configure the connection data and in the Install tab you will be able of adding a new kind of action, the "Run SQL Script" where you can include your SQL script.
Can you try if this helps you?
Regards
Alberto E.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 08, 2012
01:48 AM
I am trying to access the mysql database from java custom code. I am getting the error as ERROR:Cannot load the database driver: com.mysql.jdbc.Driver
But the same code is working fine if I ran from Eclipse.
Any help is appreciated?
And how to get the return value from Database Server Hosts? I have passed the variables to Database Server host added as MySQL . How do I know that its successfully connected to the db.
But the same code is working fine if I ran from Eclipse.
Any help is appreciated?
And how to get the return value from Database Server Hosts? I have passed the variables to Database Server host added as MySQL . How do I know that its successfully connected to the db.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 08, 2012
11:23 AM
You need to bundled the MySQL driver along your custom code.