简体   繁体   中英

SAS ODBC Connection Error

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM