New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
adilar39
Obsidian | Level 7

Hello everyone,

My office just installed SAS Viya 3.5 last November and my team leader ask me to connect the database to SAS.

The database is in MySQL format, and our SAS doesn't have data connector for MySQL, instead, we have ODBC connector. I've tried the solution from this post below, and still doesn't work.
https://communities.sas.com/t5/SAS-Programming/Suggest-me-the-Connectivity-code-for-SQL-in-SAS/td-p/...

This is the code that I use:

Libname New_lib ODBC
NoPrompt="Driver=SQL Server;Server=10.15.36.146;
Database=mysql;Uid=root;pwd=********"; 

And the error that showed up:

ERROR: CLI error trying to establish connection: [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
ERROR: Error in the LIBNAME statement.

I suspect that I need to install this connector
But maybe is there any other way to connect the database without installing that? I don't have access to the server-side of SAS Viya and I'm not familiar with Linux too.
 
Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
adilar39
Obsidian | Level 7
For the first point, I thought from the post that I linked in the question, "SQL Server" is only the default name in the installation, so I just used the same. But of course, it didn't work.
The second point, yes, the database is named mysql, but it only contains dummy data. I just want to see if I can connect it to SAS.
The third point, that's the id and password that was given to me.

Thank you for answering my question. But it looks like I'm the one whos confused with the job that was given to me.
I already found another way from this paper:
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4209-2020.pdf

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

First, I don't you can use a SQL Server driver to access MySQL, you need a specific driver for that.

Second, are you sure the rest of the parameters are correct, is your MySQL database really called mysql?

Third, you should never use root password for this kind of work, should be exclusive for server maintenece personnel only.

Data never sleeps
adilar39
Obsidian | Level 7
For the first point, I thought from the post that I linked in the question, "SQL Server" is only the default name in the installation, so I just used the same. But of course, it didn't work.
The second point, yes, the database is named mysql, but it only contains dummy data. I just want to see if I can connect it to SAS.
The third point, that's the id and password that was given to me.

Thank you for answering my question. But it looks like I'm the one whos confused with the job that was given to me.
I already found another way from this paper:
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4209-2020.pdf
Sajid01
Meteorite | Level 14

Your question is 

"I suspect that I need to install this connector https://dev.mysql.com/downloads/connector/odbc/

But maybe is there any other way to connect the daabase without installing that? I don't have access to the server-side of SAS Viya and I'm not familiar with Linux too. "
Well you need to install the SAS Access interface to ODBC or SAS Access interface to MySQL. Both are licensed products.
SAS Access interface to ODBC helps you to connect to more databases, but will require little more configuration.
adilar39
Obsidian | Level 7
Our SAS have SAS Access interface to ODBC, and from the post that I linked in the question, it showed that you can use that interface to connect MySQL format database to connect it to SAS, but I still can't figure it out.

I've read the documentation that you provided, and it's a bit complex for me.

Thank you for answering my question. But it looks like I'm the one whos confused with the job that was given to me.
I already found another way from this paper:
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4209-2020.pdf

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1866 views
  • 0 likes
  • 3 in conversation