Warning: mysqli_connect(): (HY000/1045): ProxySQL Error: Access denied for user 'root'@'2a02:4780:bad:f00d::8'

Error is:
Warning: mysqli_connect(): (HY000/1045): ProxySQL Error: Access denied for user ‘root’@‘2a02:4780:bad:f00d::8’ (using password: NO) in /storage/h9/359/1577359/public_html/connect.php on line 2

Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /storage/h9/359/1577359/public_html/connect.php on line 4

Code is:

<?php $connection = mysqli_connect("localhost", "root", ""); if(!$connection){ echo "Failed to connect database" . die(mysqli_error($connection));; } $dbselect = mysqli_select_db($connection, "user-management"); if(!$dbselect){ echo "Failed to Select database" . die(mysqli_error($connection)); } ?>

You can’t connect to the MySQL database with root privileges when you are hosted on free plan.

Make sure you put your database details i.e. username, database name and host from 000webhost.com Manage Database into your script.

1 Like