1.添加用户
默认的用户为guest,该用户只能用localhost登录,无法用ip登录,我们可以添加新的用户,Tags可以直接选择Admin。
![](https://img.haomeiwen.com/i12064261/8c5c4ac78118a321.png)
2.添加virtual host
virtual hosts默认是/,可以理解为MySQL中的数据库,就像我们一般会建自己的数据库来做开发一样,我们添加自己的“数据库”。
![](https://img.haomeiwen.com/i12064261/05cb71200775c39e.png)
点击新添加的数据库,为其赋予权限。
![](https://img.haomeiwen.com/i12064261/08f31adc598ce1a5.png)
![](https://img.haomeiwen.com/i12064261/36cc1012bbe698d4.png)
这下我们应该可以通过ip地址来访问并用刚刚创建的这个用户来登录了。在访问的时候,记得先将CentOS的防火墙关闭。
关闭命令: service iptables stop
永久关闭防火墙:chkconfig iptables off
两个命令同时运行,运行完成后查看防火墙关闭状态:service iptables status
网友评论