我能够 ping 我尝试成功连接的远程服务器。但是,在运行 MySQL 命令时:
mysql -u monty -h website.com -p
我收到以下错误:
ERROR 2003 (HY000): Can't connect to MySQL server on 'website.com' (111)
我已按照此处找到的说明进行操作,这些说明显示了如何创建具有必要权限的用户:
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> WITH GRANT OPTION;
我还在 /etc/mysql/my.cnf 中注释掉了以下行
# bind-address = 127.0.0.1
即便如此,我仍然无法远程连接。我在这里缺少什么吗?再次感谢大家。