Unknown MySQL server host

前端 未结 5 1053
Happy的楠姐
Happy的楠姐 2021-02-04 04:08

When trying to connect to my database server, i encounter the problem of unknown host:

Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2005):          


        
5条回答
  •  野的像风
    2021-02-04 04:36

    If you use this code:

    $Mysqli= new mysqli('mysql2.servidoreswindows.net:3306',
                        'usu', 'pass', 'dbname');
    

    you can try to write host without port

    That is:

    $Mysqli= new mysqli('mysql2.servidoreswindows.net', 'usu', 'pass', 'dbname');
    

提交回复
热议问题