BaseX and MySQL: Driver can't be initialized

Monday, 31 August 2015 · 4 messages · last reply 1 Sep 2015
UG
Ulrike Schaper - SideStep Business Solutions GmbH31 Aug 2015 09:27 #

Hi everybody,

I know, that this issue has been discussed already, but I still have problems concerning BaseX and MySQL:

Of course I read the documentation: I downloaded the Connector/J from the MySQL website and put the .jar file (mysql-connector-java-5.1.36-bin.jar) into the basex/lib folder. I closed and restarted the GUI and tried the following:

import module namespace sql="http://basex.org/modules/sql";
sql:init("com.mysql.jdbc.Driver")

I receive the following error message: [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

Is there something obvious I'm missing?

Best regards, Ulrike.

AH
Alexander Holupirek31 Aug 2015 18:51 #

Hi Ulrike,

it seems the Connector/J .jar is not loaded.

What OS do you use? How did you trigger the restart of BaseXGUI after putting mysql-connector-java-5.1.36-bin.jar into the lib folder?

Here is a workflow you can try (using the .zip BaseX distribution and the ./bin/basex startup files):

$ wget http://files.basex.org/releases/latest/BaseX83-20150825.081504.zip
$ unzip BaseX83-20150825.081504.zip
$ ./basex/bin/basex -q 'sql:init("com.mysql.jdbc.Driver")'
Stopped at ., 1/10:
[bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

Download Platform Independent (Architecture Independent), Compressed TAR Archive 'mysql-connector-java-5.1.36.tar.gz' from https://dev.mysql.com/downloads/connector/j/
$ tar xvjf ~/Downloads/mysql-connector-java-5.1.36.tar.gz .
$ cp mysql-connector-java-5.1.36/mysql-connector-java-5.1.36-bin.jar basex/lib
$ ./basex/bin/basex -q 'sql:init("com.mysql.jdbc.Driver")'
$

All the best Alex

Quoted text · Ulrike Schaper - SideStep Business Solutions GmbH · 18 lines
> On 31.08.2015, at 09:27, Ulrike Schaper - SideStep Business Solutions GmbH <U.Schaper at sidestep-solutions.de> wrote: > > Hi everybody, > > I know, that this issue has been discussed already, but I still have problems concerning BaseX and MySQL: > > Of course I read the documentation: I downloaded the Connector/J from the MySQL website and put the .jar file (mysql-connector-java-5.1.36-bin.jar) into the basex/lib folder. I closed and restarted the GUI and tried the following: > > import module namespace sql="http://basex.org/modules/sql"; > sql:init("com.mysql.jdbc.Driver") > > I receive the following error message: > [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver' > > Is there something obvious I’m missing? > > Best regards, > Ulrike.
UG
Ulrike Schaper - SideStep Business Solutions GmbH1 Sep 2015 09:12 #

Thanks everybody, starting the GUI from command line did the trick.

Best regards, Ulrike.

UG
Ulrike Schaper - SideStep Business Solutions GmbH1 Sep 2015 09:14 #

Thanks everybody, starting the GUI from command line did the trick.

Best regards, Ulrike.


⚡Generated with XQuery