MathGroup Archive 2011

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

Search the Archive

Re: Mathematica Beginner/Student and Mysql

Here is what I do...

(* I check to see if it is open before I try *)
OpenSQLConnection["Mrp", "Username"->"mrpadmin", "Password"->"1734admin"]]

(* define the sql string *)
str1="SELECT SerialNumber,  DateTime, OptionName, IndexNumber, Text, Scenario
WHERE (Text='Passed') AND (IndexNumber=22) AND (Scenario LIKE'Acceptance%')
ORDER BY IndexNumber";

(* execute the sql string *)

Some notes:
1. If you use GUID, you must create a view which replaces them with some other type.  Mathematica freaks out on GUIDs.
2. You must go into Start Menu -> All Programs -> Administrative Tools -> Data Sources ODBC

Make sure you add a connection to your database.  I seem to remember a catch22.  You must be able to  select the database in menu when you type only:


If it is not there, the driver is not configured properly.  Use the System DNS tab in windows to configure it (in above path).

If you try to view a relational database with their previous viewer you would get an erroneous error due to GUID.  I think this avoidable.  You must call the named database directly.  You must call a view that resolves GUID.

Paul McHale  |  Electrical Engineer, Energetics Systems  |  Excelitas Technologies Corp.

Phone:   +1 937.865.3004   |   Fax:  +1 937.865.5170   |   Mobile:   +1 937.371.2828
1100 Vanguard Blvd, Miamisburg, Ohio 45342-0312 USA
Paul.McHale at

Please consider the environment before printing this e-mail.
This email message and any attachments are confidential and proprietary to Excelitas Technologies Corp. If you are not the intended recipient of this message, please inform the sender by replying to this email or sending a message to the sender and destroy the message and any attachments.
Thank you

-----Original Message-----
From: ejules [mailto:weberejules at]
Sent: Friday, October 28, 2011 5:36 AM
To: mathgroup at
Subject: [mg122477] Matematica Beginner/Student and Mysql

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:

 JDBC["MySQL(Connector/J)", "localhost:3306/testdatabase"],
 "Name" -> "TestDB", "Username" -> "root", "Password" -> ""]
conn1 = OpensqlConnection["TestDB"]

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
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: Matematica Beginner/Student and Mysql
  • Next by Date: Re: Problem with Solve and NSolve
  • Previous by thread: Re: Matematica Beginner/Student and Mysql
  • Next by thread: Re: Matematica Beginner/Student and Mysql