Message Boards Message Boards

OpenSQLConnection[] yields KeyExistsQ error and fails

For a year or more connections to mySQL database using OpenSQLConnection fail with a "KeyExistsQ::invrl" error.

When the problem first arose, I got an error when I used a named connection that I stored. The KeyExistsQ error first appeared when I tried to create a new named connection with the Database Connection Tool. That tool now always hangs at Step 5 (connect to the database) where pushing the "test" button generates "Error: KeyExistsQ::invrl". It does not matter what I type, or even if I edit an existing named connection like "demo".

I learned to circumvent the problem by invoking JDBC driver directly with the following code, but following my most recent upgrade that fails with a similar error:

In[24]:= OpenSQLConnection[JDBC["com.mysql.jdbc.Driver","jdbc:mysql://localhost:8889"],"Catalog"->"Humboldtland","Username"->"root","Password"->"root"]
During evaluation of In[24]:= KeyExistsQ::invrl: The argument Association[Flatten[JDBCDrivers[]/. JDBCDriver[Name->DatabaseLink`SQL`Private`name_,Driver->DatabaseLink`SQL`Private`driver_,Protocol->DatabaseLink`SQL`Private`protocol_,___]:>{DatabaseLink`SQL`Private`name->Association[Rule[<<2>>],Rule[<<2>>]]}]] is not a valid Association or a list of rules.
During evaluation of In[24]:= JDBC::error: Communications link failure

The last packet successfully received from the server was 1 milliseconds ago.  The last packet sent successfully to the server was 1 milliseconds ago.
Out[24]= $Failed

Even the "demo" from Wolfram fails with similar error:

In[27]:= conn1=OpenSQLConnection["demo"]
During evaluation of In[27]:= KeyExistsQ::invrl: The argument Association[Flatten[JDBCDrivers[]/. JDBCDriver[Name->DatabaseLink`SQL`Private`name_,Driver->DatabaseLink`SQL`Private`driver_,Protocol->DatabaseLink`SQL`Private`protocol_,___]:>{DatabaseLink`SQL`Private`name->Association[Rule[<<2>>],Rule[<<2>>]]}]] is not a valid Association or a list of rules.
During evaluation of In[27]:= JDBC::classnotfound: HSQL(Standalone)
Out[27]= $Failed

Obviously there is a corrupted key-value array stored somewhere, but I cannot find it. Can you advise?

Sincerely,
David Polly
pdpolly@indiana.edu

POSTED BY: P. David Polly

I found a fix. First I completely uninstalled Mathematica, including the folders in the /Library and ~/Library paths (Mathematica and Wolfram folders). Then I reinstalled Mathematica. This fixed some of the problems, specifically I no longer received the ExistsKeyQ error and the "demo" connection worked. However, the mySQL connector/J driver failed with a JDBC error. I downloaded the latest version from mysql.com and copied to the Mathematica.app path Contents/SystemFiles/Links/DatabaseLink/Java, where I removed the existing version. After that it worked.

POSTED BY: P. David Polly
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract