{"id":11616,"date":"2014-01-31T17:52:04","date_gmt":"2014-01-31T12:22:04","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=11616"},"modified":"2014-01-31T17:52:04","modified_gmt":"2014-01-31T12:22:04","slug":"remotely-connect-multiple-rds-instances-with-phpmyadmin","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/remotely-connect-multiple-rds-instances-with-phpmyadmin\/","title":{"rendered":"Remotely Connect Multiple RDS Instances with phpMyAdmin"},"content":{"rendered":"<p>I believe every System Admin working on Amazon Cloud might have faced a scenario where clients demand control of all the RDS databases via a single PHPMyAdmin host.<\/p>\n<p>Even I have been asked to do the same from one of my clients. Many of you \u00a0might be already familiar with this process, but if you are not; I have mentioned detailed step-by-step guidelines to Remotely Connect Multiple RDS Instances with phpMyAdmin.<\/p>\n<p>Let me explain the steps which helped me accomplish client\u2019s requirement.<\/p>\n<p><strong>Firstly<\/strong>, you need to install phpMyAdmin using below command:<\/p>\n<p>[shell]$sudo apt-get install phpmyadmin[\/shell]<\/p>\n<p>After doing the same you need to ensure whether the RDS instances are accessible from the phpMyAdmin host or not.<\/p>\n<p>To check the same, you need to run the below mentioned command from your phpMyAdmin host.<\/p>\n<p>[shell]#mysql \u2013h YourRDS Endpoint -P 3306 -u Username \u2013pPassword<br \/>\n[\/shell]<\/p>\n<p>In case the RDS instance is not accessible from the host you will receive an error like:<\/p>\n<p><strong>ERROR 2003 (HY000): Can&#8217;t connect to MySQL server on <em>&#8216;Your RDS Endpoint<\/em>&#8216; (110)<\/strong><\/p>\n<p>If you do, then you need to check whether the <strong>Security Groups<\/strong> of your <strong>RDS instance has an entry of the phpmyadmin host\u2019s <em>CIDR\/IP<\/em> or <em>Security Group<\/em><\/strong> associated with the host.<\/p>\n<p>Once you have made all these changes, you can now access the RDS instance from host.<\/p>\n<p>Now we need to make changes in phpMyAdminconfig file for Multiple RDS instances connections.<\/p>\n<p>An <em>apt-get installation\u00a0of phpMyAdmin by default is done under <strong>\/etc\/<\/strong><\/em><strong>dir<\/strong> which can connect only to MySQL on localhost.<\/p>\n<p>Now in order to enable Multiple RDS instances to connect to single phpMyAdmin host, go to the<\/p>\n<p><strong><em>config.inc.php<\/em><\/strong> file under <strong>\/etc\/phpmyadmin<\/strong><\/p>\n<p>And search here for <strong>$cfg[&#8216;Servers&#8217;][$i]<\/strong><\/p>\n<p>After moving down few lines you will find a line <strong>$i++;<\/strong><\/p>\n<p>After this line add following lines.<\/p>\n<p>[shell]$cfg[&#8216;Servers&#8217;][$i][&#8216;host&#8217;] = &#8216;Your RDS Endpoint&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;port&#8217;] = &#8216;3306&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;socket&#8217;] = &#8221;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;connect_type&#8217;] = &#8216;tcp&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;extension&#8217;] = &#8216;mysqli&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;compress&#8217;] = TRUE;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;auth_type&#8217;] = &#8216;config&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;user&#8217;] = &#8216;USERNAME&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;password&#8217;] = &#8216;PASSWORD&#8217;;[\/shell]<\/p>\n<p>For <strong>another RDS host entry<\/strong> add another entry below this &amp; so on to connect more RDS hosts .<\/p>\n<p>[shell]$i++;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;host&#8217;] = &#8216;Your RDS Endpoint&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;port&#8217;] = &#8216;3306&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;socket&#8217;] = &#8221;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;connect_type&#8217;] = &#8216;tcp&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;extension&#8217;] = &#8216;mysqli&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;compress&#8217;] = TRUE;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;auth_type&#8217;] = &#8216;config&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;user&#8217;] = &#8216;USERNAME&#8217;;<br \/>\n$cfg[&#8216;Servers&#8217;][$i][&#8216;password&#8217;] = &#8216;PASSWORD&#8217;;[\/shell]<\/p>\n<p><em>\u00a0<\/em>Now navigate to URL <span style=\"color: #0000ff\">http:\/\/ElasticIPofyourhost\/phpmyadmin<\/span><\/p>\n<p>On the main page you will see an entry <strong>Server Choice.<\/strong><\/p>\n<p>Select the RDS instance you want to connect to, supply Username &amp; Password of RDS instance &amp; Get Connected !!!!<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I believe every System Admin working on Amazon Cloud might have faced a scenario where clients demand control of all the RDS databases via a single PHPMyAdmin host. Even I have been asked to do the same from one of my clients. Many of you \u00a0might be already familiar with this process, but if you [&hellip;]<\/p>\n","protected":false},"author":91,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5},"categories":[1174],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11616"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/91"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=11616"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11616\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=11616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=11616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=11616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}