正常的做法: 

  以root用户登录mysql:

    grant all privileges on *.* to 创建的用户名@"%" identified by "密码";

    flush privileges;

  例如:     

    mysql>grant all privileges on *.* to [email protected]"%" identified by "123456";

    mysql>flush privileges;

  这里就是允许zhangsan用户远程登录, 密码是123456

但是使用后发现还是远程连接不上,  原因是为了安全, lnmp禁止远程连接

  查看已有iptables规则, 用序号显示

  iptables -L -n --line-numbers

LNMP一键安装包安装的mysql远程连接不上的问题

删除对应的drop规则

  iptables -D INPUT 6

  然后远程连接, 成功连接  

相关文章:

  • 2021-06-07
  • 2021-07-29
  • 2021-04-14
  • 2021-09-23
  • 2021-12-01
  • 2021-04-12
猜你喜欢
  • 2022-12-23
  • 2021-10-10
  • 2021-11-25
  • 2021-11-17
  • 2021-04-01
相关资源
相似解决方案