MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Databaselink and MySQL

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72885] Re: [mg72873] Databaselink and MySQL
  • From: Stern <nycstern at gmail.com>
  • Date: Wed, 24 Jan 2007 05:38:05 -0500 (EST)
  • References: <200701231026.FAA09263@smc.vnet.net> <45B60F2A.5010201@wolfram.com>

Interesting. I think I am getting closer, but not quite there yet.

The connection file now reads
SQLConnection[JDBC["mysql", "localhost:3306/dbsterntest"],
 "Name" -> "MySQL test2", "Description" ->
  "test connection to dbsterntest MySQL database", "Username" -> "root",
 "Password" -> "$Prompt", "RelativePath" -> False, "Version" -> 1.]

The location is $UserBaseDirectory/DatabaseResources, as it was before.


Two problems:

1. OpenSQLConnection creates a continuous stream of errors.

Syntax::"stresc : "Unknown string escape \P. More...
Syntax::"stresc : "Unknown string escape \M. More...
Syntax::"stresc : "Unknown string escape \M. More...
Syntax::"stresc : "Unknown string escape \d. More...

2. JDBC::error: JDBC error: Communication failure during handshake. Is there a \
server running on localhost:3306?

There is a server running on localhost:3306; I have no trouble
connecting to it from dedicated MySQL client software.

More help?

Thank you in advance.

Michael Stern

On 1/23/07, Chris Williamson <chrisw at wolfram.com> wrote:
> First your conf file should contain the location of your server such...
>
> SQLConnection[JDBC["mysql", "myhost:3306/testdb"], "Name" -> "MySQL test", "Description" -> "test
> connection to MySQL database", "Username" -> "root", "Password" -> "$Prompt", "RelativePath" -> False, "Version" -> 1.]
>
>
> Next try putting your conf file in
> $UserBaseDirectory/DatabaseResources.  Then use the name to call
> OpenSQLConnection["MySQL test"].
>
> Chris
>
> Stern wrote:
> > I am trying to connect to a MySQL database using Mathematica's
> > databaselink library. I can connect to the test databases provided
> > with Mathematica (which are HSQL databases), and my MySQL databases
> > work well on their own, but when I try to connect to the MySQL
> > database from Mathematica, I get errors.
> >
> > My connection file looks like this: SQLConnection[JDBC["mysql",
> > ToFileName["C:\Program Files\MySQL\MySQL Server 5.0\data",
> > "dbsterntest"]], "Name" -> "MySQL test", "Description" -> "test
> > connection to MySQL database", "Username" -> "root", "Password" ->
> > "$Prompt", "RelativePath" -> False, "Version" -> 1.]
> >
> > I have also tried with the OpenSQLConnection command directly,
> > OpenSQLConnection[JDBC["mysql","C:\Program Files\MySQL\MySQL Server
> > 5.0\data\dbsterntest"],Username->"root",Password->"$Prompt"]
> >
> > In both cases, I get the following error: JDBC::error: JDBC error:
> > Cannot load connection class because of underlying \ exception:
> > 'java.lang.NumberFormatException: For input string: "\Program \
> > Files\MySQL\MySQL Server 5.0\data\dbsterntest"'.
> >
> > Help?
> >
> >
>


  • Prev by Date: Re: Databaselink and MySQL
  • Next by Date: pdf
  • Previous by thread: Re: Databaselink and MySQL
  • Next by thread: re: Databaselink and MySQL