0

I got this error while i was installing a Codeigniter application in my Cpanel. The strange thing is it is working very well in my localhost but not in my Cpanel. And I updated all the required fields with apt credentials..

Error

A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346

Community
  • 1
  • 1
  • I'm not sure this is the right site as it looks more like an administration issue rather than a code one – talegna Mar 11 '15 at 09:57
  • im understanding from which side the issue is but plz help me.. its an urgent important thing – Nikhil kumar Mar 11 '15 at 10:00
  • The database credentials are almost certainly different from your localhost one. You need to use the correct credentials (as the error message makes abundantly clear). – Sverri M. Olsen Mar 11 '15 at 10:01
  • can you change the database configuration page correctly..if you have not problem plz share that file – RaMeSh Mar 11 '15 at 10:09
  • all the credentials are correct and exact i checked it for 5times alphabet to alphabet.. This iis the code – Nikhil kumar Mar 11 '15 at 10:12
  • $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = ''; $db['default']['database'] = 'school'; $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; – Nikhil kumar Mar 11 '15 at 10:13
  • and i edited all the credenials correctly in the above places – Nikhil kumar Mar 11 '15 at 10:13
  • How can password be null on your live server with username root ? These seems credentials for localhost Also,this error coming up when database credentials are not proper in file – CodeWithCoffee Mar 11 '15 at 10:24
  • See im saying that in the above code i updated with right credentials but at this time im unable to keep the credentials there here are example one @tss – Nikhil kumar Mar 11 '15 at 10:28
  • $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'domain'; $db['default']['username'] = 'name'; $db['default']['password'] = 'pass'; $db['default']['database'] = 'school'; $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; – Nikhil kumar Mar 11 '15 at 10:29
  • on your server you need to create a mysql user and password. without these you wont be able to connect – CodeGodie Mar 11 '15 at 11:51
  • @Nikhilkumar You need to follow up with your question and comments provided – CodeGodie Mar 11 '15 at 13:49
  • I have done all the steps creating Uname and password n placing them in database.php file and i verified all the steps but its not working in my Hosintg but its working in other hostings. – Nikhil kumar Mar 13 '15 at 03:24
  • $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'school1'; $db['default']['password'] = 'school@123'; $db['default']['database'] = 'domainname-school'; – Nikhil kumar Mar 13 '15 at 03:26

0 Answers0