dongxun4110 2018-05-14 00:06 采纳率: 0%
浏览 212

如何使用PDO ssl连接到azure mysql数据库

I am using PDO to connect to Azure Mysql database. I have got the file i was instructed to download.

 array(
    PDO::MYSQL_ATTR_SSL_CA => '/BaltimoreCyberTrustRoot.crt.pem.txt',$port

)

But i get an error The Connection failed: SQLSTATE[HY000] [2002]

I have looked at the connection strings provided by AZURE for PHP and i didnt find one of PDO using SSL_CA like others Thanks for the help

  • 写回答

1条回答 默认 最新

  • dtzhfb4869 2018-05-14 03:12
    关注

    Which PHP version are you using? Try to use the latest one. If you enabled “peer verification”, disable it and try again. Also, try to generate a new SSL Certificate and test an endpoint on the server to ensure that it is working properly. As per this SO thread: How do I connect to a MySQL database over SSL with Laravel 5.3, If you require to use "--ssl-mode=VERIFY_IDENTITY", then you can ping your server name to resolve the regional server name, such as westeurope1-a.control.database.windows.net, and use that regional server name in the connection until this issue is resolved. Change the DB_HOST to that region and try it again.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog