我正在尝试配置Web服务器(Debian 7)。我遵循了本教程。我要租用我的服务器,这要归功于gandi.net服务。我现在已经安装并运行了apache2,mysql,php5。我在终端上使用以下命令连接到它:ssh [email protected]
下一步是通过sequel pro创建数据库,我不知道该怎么做,而且文档也不太清楚...这就是我在说的:
我试图连接:
For the rest, I left like it was and I received this error message :
Unable to connect to host domainname.com, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said: Can't connect to MySQL server on 'domainename.com' (61)' (2)
Any idea how I could do that?
If you do a normal install of MySQL on Debian, it will be configured to block external connections to the database.
This means that you still need to tell MySQL that external access is OK. To do this, you need to update the bind address for MySQL. This is configured in my.cnf
, which, on Debian based systems, is located in /etc/mysql/my.cnf
.
在那找到找到的部分
[mysqld]
在其中,您必须确保
skip-networking
要么被注释(注释以“#”开头),要么不存在,并且0.0.0.0
(如果没有行绑定地址则为)或服务器的IP地址。完成此操作后,您应该重新启动MySQL服务。然后,您需要创建一个允许远程访问的用户。这可以通过SQL查询来完成:
GRANT ALL ON yourdatabase.* TO youruser@'*' IDENTIFIED BY 'yourpassword';
如果每次连接的IP地址都相同,则可以将星号切换为要连接的IP地址。
最后,您需要在防火墙上打开端口3306(MySQL使用的端口)。这通常不是必需的,因为它已在大多数系统上打开,但是可以使用以下iptables命令来完成。
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
service iptables save
资料来源:1
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句