Mysql Connect Failed. Can't Connect To Mysql Server On 'http' (4)
Solution 1:
If your database and application is on same server then use "locahost" in $dbhost.
And if your database and application is on different servers then you need to use IP address or hostname in $dbhost and the database user should be added on database server provided with required privileges.
Solution 2:
The problem you are having was already mentioned in one of the comments, this one to be precise.
For your solution to work, all you need to do is omit the part http://
at the beginning and probably /localhost
at the end.
The host is only the domain you are referring to. In this case sql4.000webhost.com
. With /localhost you tried to already connect to a database, although your configured database is supposed to be a6410240_cbetTD
.
Solution 3:
MySQL use TCP port 3306 by default ($dbport) and hostname or IP address ($dbhost). For LAMP (Linux-Apache-MySQL-php) you can find a lot of tutorials. Usually MySQL server listens internal port (which can't be reached via Internet) for security purposes. If you familiar with docker, you can simply download examples of LAMP solutions from hub.docker.com.
Post a Comment for "Mysql Connect Failed. Can't Connect To Mysql Server On 'http' (4)"