KMatle Expert Licensed User Longtime User Jul 23, 2019 #1 I'm trying to use jShell to run MySQLDump.exe to dump a database: B4X: DumpDB.Initialize("DumpDB","C:/xampp/mysql/bin/mysqldump.exe" , _ Array As String("-u root","-pxxxxx#","dbname","> ", "C:\xampp\htdocs\enctrans\Dumps\test.sql" )) It fails with: Error: mysqldump.exe: Got error: 1045: "Access denied for user ' root'@'localhost' (using password: YES)" when trying to connect Click to expand... When I start a batch file via jShell, it works: jShell B4X: DumpDB.Initialize("DumpDB","C:\xampp\htdocs\enctrans\SQLDump.bat",Null) Batch file "SQLDump.bat" B4X: C:\xampp\mysql\bin\mysqldump -u root -pxxxxx# dbname > "C:\xampp\htdocs\enctrans\Dumps\test.sql" I assume the process doesn't need to have admin rights (or has it) because the script DOES run under the same process. Of course I tried any re-arrangement of the array (values). The format seems to be ok. Any ideas?
I'm trying to use jShell to run MySQLDump.exe to dump a database: B4X: DumpDB.Initialize("DumpDB","C:/xampp/mysql/bin/mysqldump.exe" , _ Array As String("-u root","-pxxxxx#","dbname","> ", "C:\xampp\htdocs\enctrans\Dumps\test.sql" )) It fails with: Error: mysqldump.exe: Got error: 1045: "Access denied for user ' root'@'localhost' (using password: YES)" when trying to connect Click to expand... When I start a batch file via jShell, it works: jShell B4X: DumpDB.Initialize("DumpDB","C:\xampp\htdocs\enctrans\SQLDump.bat",Null) Batch file "SQLDump.bat" B4X: C:\xampp\mysql\bin\mysqldump -u root -pxxxxx# dbname > "C:\xampp\htdocs\enctrans\Dumps\test.sql" I assume the process doesn't need to have admin rights (or has it) because the script DOES run under the same process. Of course I tried any re-arrangement of the array (values). The format seems to be ok. Any ideas?
DonManfred Expert Licensed User Longtime User Jul 23, 2019 #2 if you run a bat file. shouldn´t the process started not be cmd.exe? Away from that i would directly use mysqldump with the correct parameters. Upvote 0
if you run a bat file. shouldn´t the process started not be cmd.exe? Away from that i would directly use mysqldump with the correct parameters.
KMatle Expert Licensed User Longtime User Jul 23, 2019 #3 DonManfred said: if you run a bat file. shouldn´t the process started not be cmd.exe? Away from that i would directly use mysqldump with the correct parameters. Click to expand... Parameters should be ok. The bat file works without using cmd on WIN10. And yes, the goal is to call mysqldump.exe directly over jShell. But using cmd is definetly worth a try. Upvote 0
DonManfred said: if you run a bat file. shouldn´t the process started not be cmd.exe? Away from that i would directly use mysqldump with the correct parameters. Click to expand... Parameters should be ok. The bat file works without using cmd on WIN10. And yes, the goal is to call mysqldump.exe directly over jShell. But using cmd is definetly worth a try.
DonManfred Expert Licensed User Longtime User Jul 23, 2019 #4 KMatle said: The bat file works without using cmd on WIN10 Click to expand... Windows has registered the extension and call cmd for you. This is something other than using jshell. You can use B4X: fx.ShowExternalDocument("file:/C:xampp\htdocs\enctrans\SQLDump.bat") and let windows decide which app to open (windows will use cmd i guess). Upvote 0
KMatle said: The bat file works without using cmd on WIN10 Click to expand... Windows has registered the extension and call cmd for you. This is something other than using jshell. You can use B4X: fx.ShowExternalDocument("file:/C:xampp\htdocs\enctrans\SQLDump.bat") and let windows decide which app to open (windows will use cmd i guess).
OliverA Expert Licensed User Longtime User Jul 24, 2019 #5 I think each portion of the parameter must be separate. B4X: Array As String(“-u”, “root”, “-p”, “xxxxx”, .... and so on ) Note: posting this from phone, so wrong quotes are used. Do not copy and paste this code sample. Upvote 0
I think each portion of the parameter must be separate. B4X: Array As String(“-u”, “root”, “-p”, “xxxxx”, .... and so on ) Note: posting this from phone, so wrong quotes are used. Do not copy and paste this code sample.
KMatle Expert Licensed User Longtime User Jul 24, 2019 #6 OliverA said: I think each portion of the parameter must be separate. B4X: Array As String(“-u”, “root”, “-p”, “xxxxx”, .... and so on ) Note: posting this from phone, so wrong quotes are used. Do not copy and paste this code sample. Click to expand... I tried "all" combinations including host name and port. I even started B4J as an administrator. Parameters are fine. Anyway. Now I'm using that bat file from above which works (= start *.bat via jShell) Upvote 0
OliverA said: I think each portion of the parameter must be separate. B4X: Array As String(“-u”, “root”, “-p”, “xxxxx”, .... and so on ) Note: posting this from phone, so wrong quotes are used. Do not copy and paste this code sample. Click to expand... I tried "all" combinations including host name and port. I even started B4J as an administrator. Parameters are fine. Anyway. Now I'm using that bat file from above which works (= start *.bat via jShell)