SQLSTATE[HY000] [2002] Connection Refused


Hello everyone,

I’m trying to install e107 CMS on a new website but after several tries I’m not able to connect the SQL Database to succeed with the installation.

I’ve created the DB in my cPanel and I try to connect with :

SQL Server : localhost (even tried with
DB Username : idxxxxxxx_lotodydakt
DB pwd : mypassword (even changed it 3 or 4 times without success)
DB name : idxxxxxxx_lotodydakt

Nothing seems to work and I don’t know where I have to look as I was already user of 000webhost.com free hosting for several years and it’s the first time I’m experiencing the new version which seems to have lot of issues… :frowning:

If anyone knows where I’m wrong, please a hand should be appreciated !



@JoePT Try this,
Delete the database and then create a new one.
And then try again.

And use “localhost” as sqlserver.


Thanks @akhilkumar332 for your attention and help !

I’ve just created a new database and then tried and still same message : “SQLSTATE[HY000] [2002] Connection Refused” !

Never had any problem with the old version of 000webhost and with this one I can’t install e107 anymore !

Pfff ! I’m out of my nerves and get depressed :stuck_out_tongue:


Try the same with e107,
Delete all files and reupload it again.
And then try to install.


I deleted and re-uploaded all the files and tried to reinstall e107… SAME ISSUE : “SQLSTATE[HY000] [2002] Connection Refused” !

I don’t know yet what I can do… :frowning:


Else try after some time…as there is some internal issues going on.


Hello @akhilkumar332 and thanks for your help.

Even 12 hours later, I got always same message and I’m not able to connect to the database… I also try changing the PHP version from 5.4 to 7.1 but no way.

Here is the point that I have to give up ?



What is the full error or is that all that shows?


Hello @Infinity,

Yes, I have no other information than this same message each time…


Can you post your config.php file and install.php file?


Install.php file is over 2.000 lines… I don’t know exactly which part should be interesting for you (I’m not very keen at using and reading php)…

This is the begining (don’t know if it helps!) :
// minimal software version
define(‘MIN_PHP_VERSION’, ‘5.4’);
define(‘MIN_MYSQL_VERSION’, ‘4.1.2’);
define(‘MAKE_INSTALL_LOG’, true);

// ensure CHARSET is UTF-8 if used
//define('CHARSET', 'utf-8');

/* Default Options and Paths for Installer */
$MySQLprefix	     = 'e107_';
$HANDLERS_DIRECTORY  = "e107_handlers/"; // needed for e107 class init
header('Content-type: text/html; charset=utf-8');

define("e107_INIT", TRUE);

define("e_VERSION", $e107info['e107_version']);

/*define("e_UC_PUBLIC", 0);
define("e_UC_MAINADMIN", 250);
define("e_UC_READONLY", 251);
define("e_UC_GUEST", 252);
define("e_UC_MEMBER", 253);
define("e_UC_ADMIN", 254);
define("e_UC_NOBODY", 255);*/


if($_SERVER['QUERY_STRING'] != "debug")
	error_reporting(0); // suppress all errors unless debugging.

if($_SERVER['QUERY_STRING'] == 'clear')


function e107_ini_set($var, $value)
	if (function_exists('ini_set'))
		ini_set($var, $value);

// setup some php options
e107_ini_set('magic_quotes_runtime',     0);
e107_ini_set('magic_quotes_sybase',      0);
e107_ini_set('arg_separator.output',     '&');
e107_ini_set('session.use_only_cookies', 1);
e107_ini_set('session.use_trans_sid',    0);

if (function_exists('date_default_timezone_set'))

define('MAGIC_QUOTES_GPC', (ini_get('magic_quotes_gpc') ? true : false));

$php_version = phpversion();
if(version_compare($php_version, MIN_PHP_VERSION, "<"))
	die_fatal_error('A minimum version of PHP '.MIN_PHP_VERSION.' is required');   // no  LAN DEF translation accepted by lower versions <5.3

//  Ensure that '.' is the first part of the include path
$inc_path = explode(PATH_SEPARATOR, ini_get('include_path'));
if($inc_path[0] != ".")
	array_unshift($inc_path, ".");
	$inc_path = implode(PATH_SEPARATOR, $inc_path);
	e107_ini_set("include_path", $inc_path);

if(!function_exists("mysql_connect")  && !defined('PDO::ATTR_DRIVER_NAME'))
	die_fatal_error("e107 requires PHP to be installed or compiled with PDO or the MySQL extension to work correctly, please see the MySQL manual for more information.");

And Config.php is still empty until installation haven’t been succeed I guess !

Hope it helps


I give up !
I just would like to say that misses me the old version of 000webhost.com with whom I never had any problems… and where there was a real support…


E107 I will say is currently unsupported on the free hosting using the latest version of E107 anyhow… using an older version of E107 works fine.




@JoePT download “E107 CMS” from the link below and install.
(*Note:- Developers of e107 has solved the issue and now it is woking fine with 000webhost.)

If you’ve any issues post back or PM me.