About Mysql authorization in LAMP

Source: Internet
Author: User
About Mysql authorization in LAMP recently I learned how to build a LAMP environment. I installed centos6.2 on a virtual machine and used win to simulate remote logon. now I have encountered a problem. The virtual machine address is 192.168.159.129 & nbsp; I found this problem during Mysql Testing. how can I solve it ...... Warning: mysql authorization in LAMP
I recently learned how to build a LAMP environment. I installed centos6.2 on a virtual machine and used win to simulate remote logon. now I have encountered a problem. The virtual machine address is 192.168.159.129.
How can I solve this problem when I test 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
It seems that the mysql authorization is not properly configured. how can I set it or what kind of thinking? thank you!

------ Solution --------------------
Mysql does not allow remote access by default.
------ Solution --------------------
Log on to mysql from the local machine, go to the mysql database user table, find your connection user name, change the corresponding host to %, and then restart
------ Solution --------------------
Discussion

The test file is written like this.
$ Conn = mysql_connect ("192.168.159.129", "root", "123") or die ("mysql server connects error ");
When accessing this file, the error is the one mentioned above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.