PDO异常 - SQLSTATE [HY000] [2002]尝试以天蓝色访问权限禁止的方式访问套接字

问题描述:

I have my web app developed in PHP + mysql .where my application is deployed in Azure which is trying to access mysql at my machine. here the above mentioned error is displayed while connecting through azure to mysql db but it works perfectly when I try the app locally from my system. These are my connection strings at my .env file

DB_CONNECTION=mysql 
DB_HOST=10.79.40.233 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=blog 
DB_PASSWORD=root123 DB_ADAPTER=PDO_MYSQL

I m using php 7.1.1 version.

我的网络应用程序是用PHP + mysql开发的。我的应用程序部署在Azure中,试图访问mysql 在我的机器上。 在这里通过azure连接到mysql数据库时显示上面提到的错误,但是当我从我的系统本地尝试应用程序时,它可以正常工作。 这些是我的.env文件中的连接字符串 p>

   DB_CONNECTION = mysql 
DB_HOST = 10.79.40.233 DB_PORT = 3306 DB_DATABASE = laravel DB_USERNAME = blog 
DB_PASSWORD = root123 DB_ADAPTER = PDO_MYSQL 
  code>  pre> 
 
 

我使用的是php 7.1 .1版本。 p> div>

It may be remote acces. Try to enable remote acces on your azure web panel. Also pay attention to the connection parmeters. Check if the parameters are correct (Port , Username, Password ...)