1、cognos不直接支持mysql,所以需要通过配置ODBC来连接mysql,因为cognos只支持32位mysql,所以linux需要安装32位ODBC.
2、安装ODBC,需要安装三个包:
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
[root@bidb ~]# yum install unixODBC-2.2.14-12.el6_3.i686
[root@bidb ~]# yum install unixODBC-devel-2.2.14-12.el6_3.i686
[root@bidb ~]# yum install mysql-connector-odbc-5.3.4-1.el6.i686
安装完后配置odbcinst.ini和odbc.ini
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
配置odbcinst.ini
[root@bidb ~]# cd /etc
[root@bidb etc]# more odbcinst.ini
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbc.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbc.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
[MySQL ODBC 5.3 Unicode Driver]
Driver = /usr/lib/libmyodbc5w.so
UsageCount = 2
[MySQL ODBC 5.3 ANSI Driver]
Driver = /usr/lib/libmyodbc5a.so
UsageCount = 2
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
配置odbc.ini
[dw]
Description=MySQL
Driver=MySQL
Server=192.168.0.37
Database=dw
Port=3306
Password=123456
User=dwoper
CHARSET = UTF8
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
测试安装是否成功
[root@bidb lib64]# cd /usr/lib
[root@bidb lib]# isql -v dw dwoper 123456
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>成功后就可以进行数据源配置了。
需要注意的是配置cognos数据源的时候可能会提示无法找到libmyodbc5.so,需要去linux建立libmyodbc5.so的软连接,具体怎么创建百度吧,我也不知道,DBA弄的。