Message Boards Message Boards

GROUPS:

Connect a database in Azure to Mathematica?

Posted 1 year ago
1844 Views
|
10 Replies
|
0 Total Likes
|

Hi I have connection to SQL database via Azure Active Directory. How can I connect it to Mathematica. I have no idea how I can use this http://reference.wolfram.com/language/DatabaseLink/ref/OpenSQLConnection.html.

I can not see way to set path to database.

10 Replies

Do you know how to connect to it without Mathematica? What SQL database are you using?

This is a example on my laptop. I work with Oracle on my local machine:

Needs["DatabaseLink`"]
Needs["JLink`"]
$connection=OpenSQLConnection[JDBC["Oracle","localhost:1521/aaaa"],"Username"->"bbbb","Password"->"cccc"]

'aaaa' is the name of the database 'bbbb'/çcc' is my password & username to connect to my local database.

And then I can make my first SQL statement:

var=SQLExecute[$connection,"select * from tabelname  WHERE ROWNUM <= 972"];
Posted 1 year ago

Our back office adminer - Mysql , or Power BI

Posted 1 year ago

-Mysql I tried https://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/ to transform to Mathematica but It failed.

OpenSQLConnection[JDBC["MySQL(Connector/J)", "locahost"], 
 "Username" -> "xxxxx", "Password" -> "xxxx"]
JDBC::error: Access denied for user 'name@'localhost' (using password: YES)

Password is correct, but I have read only access. So I do not know if this is the reason why it failed.

We use also Power BI.

Posted 1 year ago

I have created dump of my Sql database. When I want to create sql connection, I will replace "localhost:1521/aaaa" by C://.......... . Is that correct? But this error appears JDBC::error: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "\Users............................"'.

what is the file format?

Posted 1 year ago

SQLText file

Can you import the file with Import[]

Posted 1 year ago

No I cant see .sql format as option

There is not a standard .sql format as each sql database has unique features so it is usually meant to be used within the same system. To export data from say MySQL into Mathematica you could use the mysqldump command with the --tab option:

https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#mysqldump-format-options

But you should be able to connect to MySQL directly using DatabaseLink. The access denies error that you are getting can probably be solved by using the MySQL GRANT command.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract