Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5982

Re: Matematica Beginner/Student and Mysql

From Michael Stern <nycstern@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Matematica Beginner/Student and Mysql
Date 2011-10-29 11:14 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j8gn7i$5bn$1@smc.vnet.net> (permalink)
References <201110280935.FAA20781@smc.vnet.net>

Show all headers | View raw


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

Needs["DatabaseLink`"];

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

SQLConnections[]
(* 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,

Michael



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 127.0.0.1:3306 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
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Matematica Beginner/Student and Mysql Michael Stern <nycstern@gmail.com> - 2011-10-29 11:14 +0000

csiph-web