我有这台服务器运行 LightHTTPD。我正在尝试访问此服务器上的 MySQL/PHPMyAdmin。到目前为止,我已经用谷歌搜索了太多并尝试了很多东西。我最近这样做了,编辑了这个文件/etc/mysql/my.conf
,添加bind-address = ip of my server;
了,然后我这样做了:
mysql -u root -p
mysql> GRANT ALL ON databasename.* TO root@'0.0.0.0' IDENTIFIED BY 'pasword';
现在,当我尝试从我授予的 IP 连接到该服务器时,它给了我这个错误:
ini_set('display_errors',1);
error_reporting(E_ALL);
define("DB_NAME","pun_update");
define("DB_USER","root");
define("DB_PASS","");
define ("DB_SERVER","ip of my server");
function connect()
{
$db_handle = mysql_connect(DB_SERVER,DB_USER,DB_PASS)
or die("Unable to Connect to Database check your settings");
mysql_select_db(DB_NAME,$db_handle) or die ("Database doesnot exist");
}
connect();
我得到这个错误:
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110