Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Debian上启用到MySQL数据库的远程连接_Mysql_Phpmyadmin_Remote Connection - Fatal编程技术网

在Debian上启用到MySQL数据库的远程连接

在Debian上启用到MySQL数据库的远程连接,mysql,phpmyadmin,remote-connection,Mysql,Phpmyadmin,Remote Connection,我已经在Debian Lenny 5.0上安装了一个MySQL数据库,我正在尝试使用PHP远程连接到该数据库 这是我登录的方式: $con = mysql_pconnect("MY_IP_ADDRESS","root","MY_PASSWORD"); if (!$con) die('Could not connect: ' . mysql_error()); 这就是我得到的错误: Could not connect: Access denied for user 'root'@'li273-1

我已经在Debian Lenny 5.0上安装了一个MySQL数据库,我正在尝试使用PHP远程连接到该数据库

这是我登录的方式:

$con = mysql_pconnect("MY_IP_ADDRESS","root","MY_PASSWORD");
if (!$con)
die('Could not connect: ' . mysql_error());
这就是我得到的错误:

Could not connect: Access denied for user 'root'@'li273-10.members.linode.com'
(using password: YES)
我不知道为什么我的linode用户会出现在那里。

为了启用远程连接,我使用了本教程:

我注意到的另一件事是,在MySQL端的phpmyadmin中,我有:

Server: localhost via TCP/IP
Server version: 5.0.51a-24+lenny5
Protocol version: 10
User: root@mycooldb
我认为localhost必须是我服务器的IP地址

我做错了什么

本教程中没有的几件事:

保存所有规则:
服务iptables save
不起作用。我得到这个错误:

-bash: service: command not found

最后,当我执行mysql-uwebadmin–hmy_IP–p时,我得到了这样一个结果:

您还需要为远程用户创建一个用户/权限。根用户的权限可能仅定义为root@localhost.

您需要定义一个用户权限,如:user@%或user@li273-10.members.linode.com

您可能不想让超级用户帐户(在本例中为root)进行远程访问


您的主机名出现在身份验证行中,因为您实际上是以身份连接到数据库的user@hostname.

这会创建密码为“password”的用户“user”并授予完全权限吗?授予在上的所有特权。使用授权选项发送到由“密码”标识的“用户”@“%”;可能重复的