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 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢