Other jShell: MySQLDump.exe (does not work) vs. batch file (works)

Discussion in 'B4J Questions' started by KMatle, Jul 23, 2019.

  1. KMatle

    KMatle Expert Licensed User

    I'm trying to use jShell to run MySQLDump.exe to dump a database:

    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:

    When I start a batch file via jShell, it works:

    Batch file "SQLDump.bat"
    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?
  2. DonManfred

    DonManfred Expert Licensed User

    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 likes this.
  3. KMatle

    KMatle Expert Licensed User

    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.
  4. DonManfred

    DonManfred Expert Licensed User

    Windows has registered the extension and call cmd for you.
    This is something other than using jshell.

    You can use
    and let windows decide which app to open (windows will use cmd i guess).
    KMatle likes this.
  5. OliverA

    OliverA Expert Licensed User

    I think each portion of the parameter must be separate.
    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.
  6. KMatle

    KMatle Expert Licensed User

    :D 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)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice