0

I can't connect to mysql database whatever I use

$autoload['libraries'] = array('database');

or

 $this->load->database();

function hangs and never returns

here is my database configurations

$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = 'root';
$db['default']['database'] = 'sms_web';
$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;

What shall i do ??

Solved Thanks for you efforts

PHP wasn't configured correctly with mysql
5
  • Is your database started ? Commented Jun 9, 2013 at 12:52
  • Yes, I am connected to it using workbench Commented Jun 9, 2013 at 12:55
  • Just keep the autoload config. I don't see anything wrong in it. I guess you've checked the usual: host, port, user, password and db ? Commented Jun 9, 2013 at 13:14
  • did it, but even if they are wrong should not $this->load->database(); returns error ?? Commented Jun 9, 2013 at 15:40
  • when i use autoload, even the welcome page is not loaded Commented Jun 9, 2013 at 16:10

1 Answer 1

0

PHP.ini file has commented loading mysql extension just i made sure of the configuration of PHP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.