1

I installed CodeIgniter latest version and Modular extension HMVC Wiredesignz HMVC Bitbucket.

It is showing annoying error in my server. If I refresh the same page for 100 times 5-10% of total refresh show this error.

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: /Library/WebServer/Documents/modular/third_party/MX/Loader.php

Line Number: 96

Screenshot of the Error

enter image description here Code in Autoload Configuration file ./autoload.php.

$autoload['packages'] = array(APPPATH.'third_party');

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

Code in database configuration file ./database.php.

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '*****';
$db['default']['password'] = '*****';
$db['default']['database'] = '*****';
$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;

Hope I am clear. Thanks in advanced.

Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
  • 1
    The author of the HMVC for CI is active on the official CodeIgniter forums - I posted this question in the [Modular Extension thread](http://codeigniter.com/forums/viewthread/179560/P190/) - maybe that can help you with your problem. – Repox Dec 14 '11 at 08:09
  • And the author behind the Modular Extension provided with this SO question: http://stackoverflow.com/questions/6324467/trouble-with-hmvc-modular-extensions-for-codeigniter – Repox Dec 14 '11 at 08:51

3 Answers3

1

Try setting one or both these attributes to FALSE:

$db['default']['pconnect'] = TRUE;

$db['default']['db_debug'] = TRUE;
Taryn
  • 242,637
  • 56
  • 362
  • 405
Ananth
  • 1,798
  • 2
  • 11
  • 8
0

It was not HMVC issue, when I change the host it is working perfectly. There might be some database server issue or file permission issue with some hosting or your settings.

Phil, Author of HMVC explained here

Trouble with HMVC modular extensions for CodeIgniter

Community
  • 1
  • 1
Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
0

change password of database user set it simple like mydb.123 and test in my case it works