[eluser]pat242[/eluser]
I get this error:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
It has happened twice on clean installs of: PYROCMS
and again on a different application I'm trying. Could it be my hosting?
my settings:
Code:
$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "bari_user";
$db['default']['password'] = "pass";
$db['default']['database'] = "bari_db";
$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";
I have tried the following:
Did test connect from an independent file and it connected:
Code:
<?php
$link = mysql_connect('localhost', 'bari_user', 'pass');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
Database is loaded:
Code:
$autoload['libraries'] = array('database');
changed the quotes:
Quote:Code:
$db['default']['hostname'] = "mysql.myhost.com";
Causes the error while:
Code:
$db['default']['hostname'] = 'mysql.myhost.com';
Works just fine. No other setting changed or anything.
tried this:
Quote:Try this, in system/database/drivers/mysql/mysql_driver.php:
Replace this (lines 59-67):
Code:
function db_connect()
{
if ($this->port != '')
{
$this->hostname .= ':'.$this->port;
}
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
with this:
Code:
function db_connect()
{
if ($this->port != '')
{
$this->hostname .= ':'.$this->port;
}
$success = @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
if(!$success) {
die('Could not connect: ' . mysql_error());
}
}