mysqli_connect(): (HY000/2002): No connection could be made
This error message typically indicates that there was a problem trying to establish a connection to the MySQL server. There can be a number of reasons for this error. Here are some things you can try:
Make sure that the MySQL server is running and that you are using the correct hostname and port number in your
If you are trying to connect to the MySQL server from a remote machine, make sure that the MySQL server is configured to allow remote connections.
If you are using a firewall or security group to block incoming connections, make sure that the MySQL port (3306 by default) is open.
Make sure that the MySQL server is not being blocked by any other firewall or security software on your server.
If you are using a local MySQL server, make sure that you have not specified the
localhostaddress in your
mysqli_connect()call. Instead, use
127.0.0.1or the actual hostname of your server.
I hope this helps! Let me know if you have any other questions.