Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Databaselink and MySQL

  • To: mathgroup at
  • Subject: [mg72882] Re: [mg72873] Databaselink and MySQL
  • From: Chris Williamson <chrisw at>
  • Date: Wed, 24 Jan 2007 05:26:03 -0500 (EST)
  • References: <>

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"].


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: text equation
  • Next by Date: Re: FourierTransform help
  • Previous by thread: Databaselink and MySQL
  • Next by thread: Re: Databaselink and MySQL