Page 1 of 1

Database Connection Failed

Posted: Mon Aug 24, 2015 9:31 am
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.

Re: Database Connection Failed

Posted: Mon Aug 24, 2015 11:25 pm
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';
?>

Re: Database Connection Failed

Posted: Tue Aug 25, 2015 10:30 pm
by Jeff
Compare what Dr. CSS wrote with the /config.php file.

Re: Database Connection Failed

Posted: Mon Nov 23, 2015 5:44 pm
by wib
Sure that it should be

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

bot $config['dbms'] = 'mysql';
?

Re: Database Connection Failed

Posted: Tue Nov 24, 2015 1:28 am
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.