php - Connection to remote mysql from localhost -
i have searched net no solution problem facing.
i working on codeigniter project running on localhost apache server. database, attempting connect ci's database.php configuration file connect remote server.
the following configuration
$active_group = 'default'; $active_record = true; $db['default']['hostname'] = 'remotedatabase.com'; $db['default']['username'] = 'remote_2102dev'; $db['default']['password'] = '1q2w3e4r5t'; $db['default']['database'] = 'remote_cs2102'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = true; $db['default']['db_debug'] = true; $db['default']['cache_on'] = false; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = true; $db['default']['stricton'] = false;
i have tried connect remote database via mysql workbench 5.5. means have did configuration correctly @ server side.
please me. ci problem or there wrong settings. thank you.
- check host entry @ remotedatabase.com. should % in host
- if php version >= 5.3 set db_debug false: $db['default']['db_debug'] = false;
Comments
Post a Comment