Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2011

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

Search the Archive

Re: Matematica Beginner/Student and Mysql

  • To: mathgroup at
  • Subject: [mg122455] Re: Matematica Beginner/Student and Mysql
  • From: Michael Stern <nycstern at>
  • Date: Sat, 29 Oct 2011 07:09:45 -0400 (EDT)
  • Delivered-to:
  • References: <>

Mathematica and MySQL work together beautifully. My connections look 
like this:


jpDB = OpenSQLConnection[
    JDBC["MySQL(Connector/J)", "localhost:3306/whateverdb"],
    Username -> "whatevername", Password -> "whateverpass"];

(* just to check that I have a good connection. If I do, it responds 
with something like "{SQLConnection[1, "Open", "Catalog" -> "whateverdb",
   "TransactionIsolationLevel" -> "RepeatableRead"]}"  *)

I generally design the tables with MySQL Workbench, and then use 
SQLInsert or SQLExecute to add data, and SQLSelect or SQLExecute to 
retrieve it. I'm not sure a detailed example would help much, as it 
would depend on the structure of your database, which is surely 
different from mine.

Good luck,


On 10/28/2011 5:35 AM, ejules wrote:
> Hello Everybody.. I hope this is the right place to post...
> I'm student and currently trying to connect a mysql database running
> locally on localhost, including the database
> Testdatabase with table Testtable.
> I try now to connect with Mathematica:
> Needs["DatabaseLink`"];
> SqlConnection[
>   JDBC["MySQL(Connector/J)", "localhost:3306/testdatabase"],
>   "Name" ->  "TestDB", "Username" ->  "root", "Password" ->  ""]
> conn1 = OpensqlConnection["TestDB"]
> SQLTableNames[conn1]
> Unfortunately my Ouptut is only a echo of what i wrote but not the
> result i'm looking for
> afterwards i would like to send standard sql queries to retrieve
> data...
> Anyone could help me? Step by step? I never used Mathematica before,
> but as my datasets are pretty large and manipulating data in tables is
> very convienient, i would really appreciate any help..
> Thank you! ejules

  • Prev by Date: Re: Problem with Solve and NSolve
  • Next by Date: Re: Mathematica Beginner/Student and Mysql
  • Previous by thread: Matematica Beginner/Student and Mysql
  • Next by thread: Re: Mathematica Beginner/Student and Mysql