Home  >  Article  >  Backend Development  >  关于LAMP中的Mysql授权的有关问题

关于LAMP中的Mysql授权的有关问题

WBOY
WBOYOriginal
2016-06-13 13:32:49744browse

关于LAMP中的Mysql授权的问题
最近在学习搭建LAMP环境,用的是虚拟机上面安装centos6.2,然后用win模拟远程登录,现在遇到一个问题。那个虚拟机的地址是192.168.159.129
 我测试Mysql时发现,这个问题,请问要怎么解决啊……
Warning: mysql_connect() [function.mysql-connect]: Host '192.168.159.129' is not allowed to connect to this MySQL server in /usr/local/apache2/htdocs/site/test.php on line 2
貌似是mysql的授权没有设置好,具体怎么设置啊,或是什么样的思路,谢谢!

------解决方案--------------------
mysql 默认是不允许远程访问的
------解决方案--------------------
本机登入mysql,进入mysql库user表,找到你连接的用户名,把对应的host修改成 % 再重启下
------解决方案--------------------

探讨

那个测试文件里面是这样的写的
$conn=mysql_connect("192.168.159.129","root","123")or die("mysql server connects error");
访问这个文件,产生的错误就是上面说的那个
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn