is not allowed to connect to this mysql server

授权法。

例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

如果是lnmp下安装

为了安全起见,lnmp环境是禁止远程连接的,他会删除iptables里面的3306端口的防火墙规则

iptables里面删除drop 3306端口

将所有iptables 以序号标记显示,执行:
iptables  -L -n --line-numbers
添加3306端口号到防火墙
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
service iptables save
service iptables restart
service mysql restart

posted @   lenton  阅读(20)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示