Unable to mysqli_connect()@mysql8 -- mysql8 STILL down?


[Sorry to post in a new thread – the previous thread was closed and can’t post more]

Still unable to connect MySQL server on ‘mysql8.000webhost.com’. I got the old control panel.

Investigation: MySQL server (mysql8.000webhost.com) is NOT reachable from the web-server (mybudget.netne.net).

details of connecting/ping from webserver:

Failed to connect to MySQL: Can’t connect to MySQL server on ‘mysql8.000webhost.com’ (113)

Warning: fsockopen() [function.fsockopen]: unable to connect to mysql8.000webhost.com:3306 (Connection timed out) in /home//public_html/test.php


Can you try the three methods down the middle of the tutorial to see if any work for connection?

Method 1 — Connecting to the database using PDO (recommended)

$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
    // set the PDO error mode to exception
    echo "Connected successfully"; 
    } catch(PDOException $e) {    
    echo "Connection failed: " . $e->getMessage();

Method 2 — Connecting to the database using mysqli (Object-Oriented)


$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";

// Create connection
$conn = new mysqli($servername, $username, $password, $database);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
echo "Connected successfully";

Method 3 — Connecting to the database using mysqli_connect (Procedural)


$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());

echo "Connected successfully";


I use method 2 to connect. Unfortunately, it did not work.

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can’t connect to MySQL server on ‘mysql8.000webhost.com’ (113)

Connection failed: Can’t connect to MySQL server on ‘mysql8.000webhost.com’ (113)

I even can’t seem to ping the MySQL server from my local machine or the web-server [1-2].

[1] http://stackoverflow.com/questions/9841635/how-can-i-ping-a-server-port-with-php
[2] http://stackoverflow.com/questions/1239068/ping-site-and-return-result-in-php


I know remote connections to MySQL are blocked in the free hosting so you can’t remotely connect but since your script is on your hosting I’m not sure why it can’t access the database.


How can I check the status of the mysql server in the same spirit as [1]? Others [2] are facing problems connecting to mysql8.

[1] http://status.000webhost.com/
[2] Is there something wrong with mysql host: mysql8.000webhost.com


I just use status.000webhost.com to keep an eye on uptime etc.


As far as I can see the database server is still functioning?



Yes, phpmyadmin is working. This happened last time where phpmyadmin was working but was unable to connect with php [1]. Then, was able to connect the very next day.

Any changes to firewall rules at your end? or upgrades?

[1] Unable to mysqli_connect()@mysql8 today -- mysql8 down?


Still down, James. I’ll try tomorrow to check if any change in status.


When I try to open phpMyAdmin [2], it gives me a blank page. I do NOT see “mysql8.000webhost” anywhere on [1]. Others seem to have problems connecting [3,4]. Not sure what else I can do? reach out to community?

[1] http://status.000webhost.com/778339538
[2] http://sql8.000webhost.com/phpMyAdmin/
[3] Unable to connect to mysql with 000webhost
[4] Is there something wrong with mysql host: mysql8.000webhost.com


Hopefully the staff member is resolving this issue.



I am also experiencing the same issue. I went through any other fix that I could find (change pwd, new db, even reinstalling wordpress), but no success.

This happens since 2 days ago on my side.


Even more are affected by mysql8 down [1,2]. Down since 31st (dec 16).

[1] Is there something wrong with mysql host: mysql8.000webhost.com
[2] Mysql8.000webhost.com is down?


i can now connect to MySQL. Thanks James for answering my queries. Thanks staff member for resolving this issue.