Warning: mysqli_connect(): MySQL server has gone away

前端 未结 2 1221
忘掉有多难
忘掉有多难 2021-01-13 13:01

I wrote a simple php code to connect to the mysql server as below

    

        
2条回答
  •  野的像风
    2021-01-13 13:50

    The error is here:

    $hostname = "localhost:81";
    

    You are not connecting to MySQL, but to Apache server. If you didn't change MySQL port just use

    $hostname = "localhost";
    

提交回复
热议问题