我正在尝试使用db4free.net上的外部mysql数据库在heroku上托管一个codeigniter项目。
我尽力而为,但我最后的努力看起来像这样
$db['mysql'] = array(
'dsn' => 'mysql:hostname="db4free.net"; dbname=ravenstock',
'hostname' => '',
'username' => 'ravenstockadmin',
'password' => '**************',
'database' => '',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
答案 0 :(得分:0)
请尝试一下...
'hostname' => '45.113.122.253:3306',
'username' => 'your server username',
'password' => 'your server password',
'database' => 'server database name',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE