lnmp环境下 链接远程数据库
一、phpmyadmin 权限里将要远程连接的用户的主机改成* 参考 https://bbs.vpser.net/thread-3135-1-1.html
或mysql -u root -p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>exit;
root可以换成你的用户名
如果没有创建用户,执行grant all PRIVILEGES on 数据库名.* to 用户名@'%' identified by '密码'
二、iptables 里删除DROP 3306端口的规则。参考iptables教程:https://www.vpser.net/security/linux-iptables.html
要删除已添加的iptables规则
将所有iptables以序号标记显示,执行:
iptables -L -n --line-numbers
比如要删除INPUT里序号为8的规则,执行:
iptables -D INPUT 8
浙公网安备 33010602011771号