dongyidao1461 2011-09-19 01:33
浏览 88

使用PHP连接EC2中的RDS

I am new to AWS. I have one EC2 instance and one RDS instance. I have everything installed and ports opened on both of them. I could able connect to my EC2 instance with PuTTy and able to FTP with WinSCP and is all good. I could even be able to login to my RDS instance and check all my databases from my computer with mysql CLI. But my php pages in EC2 instance and not communicating with RDS instance. I don't know why? I even tried to connect from my ec2 instance normally using mysql command and I achieved that. But not through my php file.

Error that I am getting, when I am trying to connect is Access denied for user 'ec2-user'@'.ap-southeast-1.compute.internal' (using password: YES)

Have anyone faced this type of connectivity problem earlier, could any one help me to achieve this,

Addition: Hi, I observed that my EC2 instance is in location southeast-1a and my RDS in southeast-1b. But with my RDS I don't have any option to choose availability zone as I enabled Multi-AZ option. Hope if that helps a bit more.

Thanks, Murali.

  • 写回答

1条回答 默认 最新

  • dongling2038 2011-09-19 02:34
    关注

    Have you tried:

    GRANT SELECT ON database.* TO 'ec2-user@'servername.ap-southeast-1.compte.internal' IDENTIFIED BY 'password';
    

    you may need to add additional permissions based on what you decide to grant

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据