Database Connection Failed

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Locked
masoyuser
New Member
New Member
Posts: 1
Joined: Mon Aug 24, 2015 8:52 am

Database Connection Failed

Post by masoyuser »

Hello.

Our website doesn't work anymore.It gives error messages as follows:

Error: Access denied for user 'cms'@'localhost' (using password: YES) (1045) Function Performed: CONNECT
Host/DB: localhost/cms
Database Type: mysql
Fatal error: Attempt to connect to database cms on cms@localhost failed in /var/.../xxxxxx/www.xxxxxxxx/.../.../lib/adodb.functions.php on line 85

xxxxx = our company

What is wrong ?

Best regards,
J.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Database Connection Failed

Post by Dr.CSS »

A default newer install should look like so, check yours, also check that your host didn't change something...

***** is whatever your creds are...

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysqli';
$config['db_hostname'] = 'localhost';
$config['db_username'] = '*****';
$config['db_password'] = '*****';
$config['db_name'] = '****';
$config['db_prefix'] = 'cms_';
$config['db_port'] = 0;
$config['timezone'] = 'America/Denver'; ...your settings here...
$config['default_encoding'] = 'utf-8';

These last 2 are only for pretty URLs...

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
?>
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Database Connection Failed

Post by Jeff »

Compare what Dr. CSS wrote with the /config.php file.
wib
Forum Members
Forum Members
Posts: 13
Joined: Sat Oct 29, 2011 4:55 pm

Re: Database Connection Failed

Post by wib »

Sure that it should be

$config['dbms'] = 'mysqli';

bot $config['dbms'] = 'mysql';
?
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Database Connection Failed

Post by Jeff »

Yes, 'mysql' is depreciated it is replace with 'mysqli'.

If your host still has you use 'mysql' then your host has WAY outdated software on their servers.
Locked

Return to “The Lounge”