【问题标题】:#1045 - Access denied for user 'azure'@'localhost' (using password: YES)#1045 - 用户 'azure'@'localhost' 的访问被拒绝(使用密码:是)
【发布时间】:2021-08-10 13:21:19
【问题描述】:

我正在为我的 PHP 应用程序使用 Azure Web App 服务。

在我的 PHPMyAdmin 仪表板中,当我运行以下查询时出现错误:

我的查询:

GRANT ALL PRIVILEGES ON *.* TO 'poc-qa-team'@'%';

错误:

#1045 - Access denied for user 'azure'@'localhost' (using password: YES)

知道如何完成这项工作。

此外,

ON URL:  https://xyz-dev.azurewebsites.xyz/installer/ 

    Fatal error: Uncaught Error: Call to undefined function apache_get_version() in 

D:\home\site\wwwroot\installer\index.php:43 Stack trace: #0 

D:\home\site\wwwroot\installer\index.php(232): checkDependencies() #1 {main} thrown in 

D:\home\site\wwwroot\installer\index.php on line 43 

注意:同一应用在 Azure VM LAMP 堆栈中运行良好

【问题讨论】:

  • 您是如何尝试运行查询的?该错误与查询没有直接关系,但可能与用户只能连接到 localhost 而不能连接到任何远程主机这一事实有关
  • 您向poc-qa-team 授予权限,但应用程序以azure 作为用户名连接????
  • 那么 azure Web 服务是否允许我们运行此查询,或者如何从 azure 授予权限,或者此查询无法在 azure Web 服务上运行的 PHPMyAdmin 仪表板上运行?

标签: php mysql azure-devops phpmyadmin azure-web-app-service


【解决方案1】:

用关键字Access denied for user 'azure'@'localhost' (using password: YES)搜索此问题后。

问题的原因应该还是连接字符串中的用户名和密码。我得出的结论是,您可以尝试通过以下方式解决问题。

1.创建 .env 文件。

Laravel app on Azure: Access denied for user 'azure'@'localhost'.

2.尝试修改连接字符串,User的值应该是username@hostname

mysqli_real_connect(): (HY000/1045): Access denied for user 'azure'@'localhost' (using password: YES)

【讨论】:

    猜你喜欢
    • 2013-05-26
    • 1970-01-01
    • 2018-12-12
    • 2014-06-06
    • 2016-07-11
    • 2019-12-12
    • 2016-05-05
    • 1970-01-01
    相关资源
    最近更新 更多