Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5963 > unrolled thread
| Started by | ejules <weberejules@gmail.com> |
|---|---|
| First post | 2011-10-28 09:42 +0000 |
| Last post | 2011-10-30 09:20 +0000 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Matematica Beginner/Student and Mysql ejules <weberejules@gmail.com> - 2011-10-28 09:42 +0000
Re: Matematica Beginner/Student and Mysql A Retey <awnl@gmx-topmail.de> - 2011-10-29 11:10 +0000
Re: Matematica Beginner/Student and Mysql Chris Degnen <degnen@cwgsy.net> - 2011-10-29 11:13 +0000
Re: Matematica Beginner/Student and Mysql David Reiss <dbreiss@gmail.com> - 2011-10-29 11:09 +0000
Re: Matematica Beginner/Student and Mysql ejules <weberejules@gmail.com> - 2011-10-29 11:13 +0000
Re: Matematica Beginner/Student and Mysql Armand Tamzarian <mike.honeychurch@gmail.com> - 2011-10-30 09:20 +0000
| From | ejules <weberejules@gmail.com> |
|---|---|
| Date | 2011-10-28 09:42 +0000 |
| Subject | Matematica Beginner/Student and Mysql |
| Message-ID | <j8dtds$kff$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | A Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2011-10-29 11:10 +0000 |
| Message-ID | <j8gmuu$55n$1@smc.vnet.net> |
| In reply to | #5963 |
Hi, > 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... Mathematica is case sensitive, so you want OpenSQLConnection. SQLConnection is not meant to be "defined" but is only a header for the expression that a correct OpenSQLConnection call will return and which can then be used for the other commands, like SQLTableNames. If you want to reuse a certain connection, you can save it with an associated name and then use that name as you tried in your OpenSQLConnection, see the section "Named Connections" in the databaselink tutorial about details (entering DatabaseLink/tutorial/DatabaseConnections#13985 into the documentation search field should directly navigate to that section). I would suggest you start with connecting to the example databases as shown in the DatabaseLink documentation. Once you have that working, you can try to open a connection to your MySQL database, with something like: conn1 = OpenSQLConnection[ JDBC["MySQL(Connector/J)", "localhost:3306/testdatabase"], "Name" -> "TestDB", "Username" -> "root", "Password" -> ""] > 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.. if you have not used Mathematica before, I would also suggest to first spend some time to get an overview of Mathematica before trying any serious work. It is powerful but has many pitfalls, especially if one is used to other systems/languages. hth, albert
[toc] | [prev] | [next] | [standalone]
| From | Chris Degnen <degnen@cwgsy.net> |
|---|---|
| Date | 2011-10-29 11:13 +0000 |
| Message-ID | <j8gn5l$5af$1@smc.vnet.net> |
| In reply to | #5963 |
On Oct 28, 10:42 am, ejules <webereju...@gmail.com> 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 Needs["DatabaseLink`"] conn1 = OpenSQLConnection[JDBC["mysql", "localhost:3306/ testdatabase"], Username -> "root", Password -> ""]; SQLTableNames[conn1]
[toc] | [prev] | [next] | [standalone]
| From | David Reiss <dbreiss@gmail.com> |
|---|---|
| Date | 2011-10-29 11:09 +0000 |
| Message-ID | <j8gmtv$54u$1@smc.vnet.net> |
| In reply to | #5963 |
Try OpenSQLConnection rather than OpensqlConnection (i.e., SQL rather than sql). Case counts. --David On Oct 28, 5:42 am, ejules <webereju...@gmail.com> 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
[toc] | [prev] | [next] | [standalone]
| From | ejules <weberejules@gmail.com> |
|---|---|
| Date | 2011-10-29 11:13 +0000 |
| Message-ID | <j8gn4m$59o$1@smc.vnet.net> |
| In reply to | #5963 |
On Oct 28, 11:42 am, ejules <webereju...@gmail.com> 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 Thank you a lot for the help, Correct syntax is: Needs["DatabaseLink`"] conn1 = OpenSQLConnection[JDBC["mysql", "localhost:3306/ testdatabase"], Username -> "root", Password -> ""]; SQLTableNames[conn1]
[toc] | [prev] | [next] | [standalone]
| From | Armand Tamzarian <mike.honeychurch@gmail.com> |
|---|---|
| Date | 2011-10-30 09:20 +0000 |
| Message-ID | <j8j4t7$esu$1@smc.vnet.net> |
| In reply to | #5963 |
On Oct 28, 8:42 pm, ejules <webereju...@gmail.com> 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
Needs["DatabaseLink`"];
conn = OpenSQLConnection[
DatabaseLink`JDBC[ "MySQL(Connector/J)",
"localhost:3306/testdatabase"], "Username" -> "root",
"Password" -> ""];
your connection to testdatabase should now be open. So try this out
out:
SQLExecute[conn, "SELECT * FROM testdatabase LIMIT 10"]
Mike
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web