Jump to content



Photo
- - - - -

Error-Unable to connect DB server

connect database

  • Please log in to reply
3 replies to this topic

#1   Anusha

Anusha
  • Members
  • 1 posts
  • Real Name:Anusha

Posted 02 August 2016 - 16:36

Hi,

I created my website in localhost and is working fine. After web hosting, I am getting the following error.

 

Unable to connect to database server!

 

I updated the configure.php as below:

 

define('DB_SERVER', '127.0.0.1');

  define('DB_SERVER_USERNAME', 'hosur513_admin');
  define('DB_SERVER_PASSWORD', 'admin123');
  define('DB_DATABASE', 'hosur513_anugraha');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'mysql');
  define('CFG_TIME_ZONE', 'Indian/Mahe');
 
Please help.
 
Thanks
Anusha


#2   Jack_mcs

Jack_mcs
  • Members
  • 28,356 posts
  • Real Name:Jack
  • Gender:Male

Posted 02 August 2016 - 17:41

The database credentials for localhost, which I assume you mean a local server, will be different than a live server. You need to set up the database on the live server and use those credentials for the configure file.



#3   peterindexed

peterindexed

    PHP developer

  • Members
  • 1 posts
  • Real Name:Peter Sørensen
  • Gender:Male
  • Location:Denmark

Posted 20 September 2016 - 19:30

year, just update the config with the localhost credentials


love developing so made my own cool webshop

#4   ecommunlimited

ecommunlimited
  • Members
  • 268 posts
  • Real Name:William G. Sibert
  • Gender:Male
  • Location:Newark, Ohio USA

Posted 21 September 2016 - 12:09

You really shouldn't make posts with your database Username, Password and the name of your database. You should change the immediately. Everything you post on here goes on Google and other search engines. This site gets crawled just like all other sites. You should change the name of your admin as well.