Using PHPMyAdmin to administer Amazon RDS

后端 未结 9 995
挽巷
挽巷 2020-12-02 10:02

I can\'t get PHPMyAdmin to connect to my Amazon RDS instance. I\'ve granted permissions for my IP address to the DB Security Group which has access to this database I\'m tr

相关标签:
9条回答
  • 2020-12-02 10:28

    In Debian Lenny using the phpmyadmin from the repo add this to /etc/phpmyadmin/config.inc.php :

    $i++;
    $cfg['Servers'][$i]['host'] = 'xxxxx.xxxxxxxxxx.us-east-1.rds.amazonaws.com';
    $cfg['Servers'][$i]['port'] = '3306';
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $cfg['Servers'][$i]['compress'] = TRUE;
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'xxxxxxxxxxxx';
    $cfg['Servers'][$i]['password'] = 'xxxxxxxxxxxxxxxxxx';
    
    0 讨论(0)
  • 2020-12-02 10:29

    I had the same problem and nothing of the above solved it.

    As it turned out the thing was in "Publicly Accessible" option of the RDS instance. When you create your instance this option is "no" by default and there is no place you can change it.

    However, after creating the RDS instance you can make its snapshot, then delete the instance and then launch the snapshot. In launch options just set "Publicly Accessible" to "yes" and your phpMyAdmin will finally see you RDS MySql server.

    Beware that DNS of the original RDS instance and the snaphot are different so you would have to change your 'host' in config.inc.php

    Cheers :)

    0 讨论(0)
  • 2020-12-02 10:29

    If you can connect from the cli using mysql -h ENDPOINT -u USERNAME -p but not from PHPMyAdmin or your own web scripts, don't forget to tell selinux to let your web server talk to the network :)

    sudo setsebool -P httpd_can_network_connect=1
    
    0 讨论(0)
  • 2020-12-02 10:30

    You need to add the RDS instance as an additional server listed on PHPMyAdmin while granting the host PHPMyAdmin access to your RDS instance.

    More details from this blog post on How to remotely manage an Amazon RDS instance with PHPMyAdmin:

    The one thing I had trouble with was the DB Security Group setup. When you go to add access for an CIDR/IP it provides a recommended value. It took some messing around to determine that this default value isn’t actually what needed to be there. If you’re not able to connect to your instance when it’s all said and done, be sure to double check this value. The IP they provided did not match the IP address that was provided to us by our ISP. Once you’ve created your DB Instance and setup the security group you’re good to go.

    I’m going to assume you’ve already got PHPMyAdmin up and running. What you need to do is modify config.inc.php to recognize the new server.

    0 讨论(0)
  • 2020-12-02 10:30

    Try to connect from the mysql command line (http://dev.mysql.com/doc/refman/5.1/en/mysql.html) and see what's this utility returns you. I found it's easier to debug that way.

    mysql -hMY-DB.us-east-1.rds.amazonaws.com -uMASTER-USER -pPASSWORD
    

    If that's doesn't work, it means your amazon RDS security aren't configured correctly. (which is the common problem).

    0 讨论(0)
  • 2020-12-02 10:31

    I use ubuntu shell to access Amazon RDS. first of all go to ubuntu root

    sudo -i
    

    to do this use amazon RDS end user URL

    mysql -h gelastik.cqtbtepzqfhu.us-west-2.rds.amazonaws.com -u root -p
    
    0 讨论(0)
提交回复
热议问题