mysql_connect(): No connection could be made because the target machine actively refused it

后端 未结 10 1875
长情又很酷
长情又很酷 2020-11-30 12:41

I have this problem when I am trying to run my PHP MySQL script. When I try to run my .php file this is what I get.

mysql_connect(): No connection could be m         


        
10条回答
  •  时光取名叫无心
    2020-11-30 12:54

    I had the same problem.

    There are two database engines - MySQL DB and Maria DB. In your system, the database engine which is working may not over the default port. So check the active database engine and its port. Connect the database using:

    mysqli_connect(host, username, password, dbname, port, socket)

    for example:

    mysqli_connect("localhost", "username", "password", "dbname", "3307")

    The port number is available in the my.ini file or in the status menu of wampserver.

提交回复
热议问题