2013-05-10 135 views
1

如果我使用ODBC連接到Sybase,我應該在database.php文件中使用什麼設置?Codeigniter Sybase數據庫配置

$db['default']['hostname'] = ""; 
$db['default']['username'] = "root"; 
$db['default']['password'] = ""; 
$db['default']['database'] = "database_name"; 
$db['default']['dbdriver'] = ""; 

我知道mysql的主機名是localhost,dbdriver是mysql。那麼Sybase呢?主機名應該放在什麼位置?和dbdriver?它是ODBC嗎?

謝謝。

+0

什麼Sybase產品正在嘗試連接到? ASE,SQLAnywhere?您是否下載了Sybase ODBC驅動程序? – 2013-05-10 12:09:57

回答

0
$db['default']['hostname'] = "Driver=Adaptive Server Anywhere 7.0;ENG=your_server_sybase ;UID=youruser;PWD=yourpswrd;DBN='';LINKS=TCPIP(HOST=127.0.0.1:9000) " 

HOST = 127.0.0.1:9000 端口9000

或 HOST = 127.0.0.1


$db['default']['username'] = ""; 
$db['default']['password'] = ""; 
$db['default']['database'] = ""; 
$db['default']['dbdriver'] = "odbc";