2
votes

I am trying to use SAS v9.0 to connect to a MySQL database on a Windows 7 machine. Below is the code I am using.

proc sql;
connect to odbc(datasrc=localhost user= root password=password);
create table tmp as 
select * 
from connection to odbc 
(  
select * from mysql.time_zone 
)  
;
quit;

This is giving me following error.

ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I am using the MySQL ODBC 5.1 Driver.

1
You'll increase your chances of getting a good answer if you go back and "accept" answers to some of your prior questions.Aaron
I am a newbie here and didn't know how to accept. Thanks for the tip.SumitGupta
Go back to some of your prior questions, pick the best answer, hover over the outline of a check-mark (under the vote score) and click to accept.Aaron
Yes, I figured that out. Thanks.SumitGupta
Is there a piece missing from the start of your question?jilles de wit

1 Answers

1
votes

Looks like you haven't set your ODBC data source in windows. Go to start->control panel->system and security->administration->ODBC data sources. Select "add", provide all information asked. Then you should provided ODBC data source name when you submit your proc sql datasrc option.