cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
james_decosta
Level 9

how shall i achieve this with mysql

hi,
i have a requirement wherein i need to run some sql scripts after installation
,i am using a batch file wherein i am writing this command:

mysql -ulocalhost -uroot -proot -P3306 < C:\something.sql
But now i want to remove this hard coding and therefore i want to use this command.

mysql -ulocalhost -uroot -proot -P3306 < %SQL_HOME%\something.sql
But the error stack trace in stderr.log is
OUT:
OUT:
OUT: C:\DOCUME~1\xxxx\LOCALS~1\Temp\I1199360856\Windows>set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32;D:\eclipse\plugins\org.apache.ant_1.6.5\bin;C:\WINDOWS\system32;C:\Program Files\Java\jdk1.5.0_08\bin;;C:\Program Files\MySQL\MySQL Server 5.0\bin
OUT:
OUT:
OUT: C:\DOCUME~1\xxxxxx\LOCALS~1\Temp\I1199360856\Windows>mysql -ulocalhost -uroot -proot -P3306 0<\something.sql
ERR: The system cannot find the file specified.
OUT:
OUT:
OUT: C:\DOCUME~1\xxxxx\LOCALS~1\Temp\I1199360856\Windows>mysql -ulocalhost -uroot -proot -P3306 0<\yyyyyy.sql
ERR: The system cannot find the file specified.
OUT:
OUT:
OUT: C:\DOCUME~1\xxxx\LOCALS~1\Temp\I1199360856\Windows>mysql -ulocalhost -uroot -proot -P3306 0<\zzazzzz.sql

How shall i overcome this problem.
I want to install the sql scripts in the $USER_INSTALL_DIR$ and load the file from there using
mysql -ulocalhost -uroot -proot -P3306< $USER_INSTALL_DIR$$\$something.sql
But mysql does not recognise this And my installer searches for it in Temp folder ,How shall i overcome this issue
ERR: The system cannot find the file specified.
OUT:
OUT:
OUT: C:\DOCUME~1\xxxx\LOCALS~1\Temp\I1199360856\Windows>mysql -ulocalhost -uroot -proot -P3306 0<\yyyyy.sql
ERR: The system cannot find the file specified.
OUT: done reading
ERR: done reading
Labels (1)
0 Kudos
(5) Replies
Yves_Kreis
Level 7

Call the command file as

file.cmd $USER_INSTALL_DIR$

and inside the file.cmd use the following call

mysql -ulocalhost -uroot -proot -P3306< $1\something.sql


Best Regards,
Yves
0 Kudos
james_decosta
Level 9

hi yves,
can i use this script for calling eclipse.exe

file.cmd $USER_INSTALL_DIR$$\eclipse
call eclipse.exe -data $1\Workspace

This script is used for calling eclipse which i install in the user install folder with a worspace and then i want to start eclipse.exe with my workspace.
How to do it.
0 Kudos
Yves_Kreis
Level 7

file.cmd $USER_INSTALL_DIR$$\$eclipse
call eclipse.exe -data "$1\Workspace"

P.S.: First test your idea, then ask if it is not working!

Best Regards,
Yves
0 Kudos
james_decosta
Level 9

HI,
the script i used is
file.cmd $USER_INSTALL_DIR$$\$eclipse
call eclipse.exe -data "$1\Workspace"
But eclipse did not startup, i am unable to grasp what is wrong.

and when i use this script for calling:

start /?
start "" "$USER_INSTALL_DIR$$\$eclipse$\$eclipse.exe" -data "$USER_INSTALL_DIR$$\$WorkSpace"
the script is calling but the user needs to enter any key which is not user friendly.
Please provide any suggestion for this.
And even when i start the jboss (run.bat) by this script:

cd $USER_INSTALL_DIR$$\$jboss$\$bin
$USER_INSTALL_DIR$$\$jboss$\$bin$\$run.bat
,EVEN THIS DOES NOT WORK WHEN $USER_INSTALL_DIR$ IS SAY
C:\Program Files\SOMETHING
when the folder choosen contains space in between
0 Kudos
Yves_Kreis
Level 7

Try without the start...
Or paste an executable...

Best Regards,
Yves
0 Kudos