设置MySQL远程链接


//更改mysql自身数据库‘mysql’
use mysql;
select host,user,password from user;

//%允许任何主机连接本数据库,
grant all privileges on *.* to 'root'@'%' identified by 'XXXXXXXXX' with grant option;

//重置mysql服务;
flush privileges;

//退出mysql
exit;

//如果有防火墙,确保打开3306端口
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

//开关防火墙(重启)
chkconfig iptables on
chkconfig iptables off

//临时开关防火墙
service iptables start
service iptables stop

//连接方命令:
mysql -u root -p -h 地址

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

最新文章

Tags Cloud

blender Blizzard CentOS6.3 Dream Evernote笔记同步 Game goagent Google Hellboy漫画系列 HTML5 KB5070311 Linux lnmp Maya Movies mysql nginx php reproduce SATA mode scp SSH storyboard SwitchyOmega The Simpsons to-page wordpress 动画 大三 定格动画 挂科 每日一Bia 毕业设计 漫画 漫画日记 眼高手低 美国恐怖故事 考试 自信 色彩Color 辛普森一家 远程桌面 速写 那时我年幼 阿里云

黑历史

ADs