Error while reading greeting packet

一曲冷凌霜 提交于 2019-12-30 10:03:47

问题


i have problem ... im tring to connect to server in netbeans .... I write the code as bellow:

<?php
echo "wlecome";
echo "<br>";

$conn=mysqli_connect("mydomain.com:2082", "phpmyadmin_user", "password","database_name");

echo $conn;
?>

runing of this code return this erreurs:

wlecome

Warning: mysqli_connect(): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10

Warning: mysqli_connect(): Error while reading greeting packet. PID=1092 in C:\xampp\htdocs\myprojet\index.php on line 10

Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\myprojet\index.php on line 10

I googled a lot, but either I used the wrong keywords or there are no simple solutions on the internet. I hope somebody here can help me.

Best regards and thanks in advance, Fadel.


回答1:


MySQL can be configured to not accept external connections, for security reasons. By saying the full domain name, you are using the public IP and therefore you are an external connection. If MySQL is running on the same box as your webserver, just access it via this domain name:

localhost:2082


来源:https://stackoverflow.com/questions/18803440/error-while-reading-greeting-packet

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!