{"id":132502,"date":"2023-03-16T12:48:23","date_gmt":"2023-03-16T12:48:23","guid":{"rendered":"https:\/\/phppot.com\/?p=20579"},"modified":"2023-03-16T12:48:23","modified_gmt":"2023-03-16T12:48:23","slug":"phpmyadmin-how-to-connect-a-remote-database","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2023\/03\/16\/phpmyadmin-how-to-connect-a-remote-database\/","title":{"rendered":"phpMyAdmin \u2013 How to Connect a Remote Database?"},"content":{"rendered":"<div class=\"modified-on\" readability=\"7.0909090909091\"> by <a href=\"https:\/\/phppot.com\/about\/\">Vincy<\/a>. Last modified on March 16th, 2023.<\/div>\n<p>Do you want to connect a remote server from the phpMyAdmin installed on a local or test server? This article gives the steps needed to achieve it.<\/p>\n<p>There are many database clients, most of which support connecting a database server. But, working with phpMyAdmin to connect to a remote database server is heavenly easier than with other clients.<\/p>\n<p>We have seen many tutorials for <a href=\"https:\/\/phppot.com\/mysql\/phpmyadmin-create-database\/\">phpMyAdmin to create a database<\/a> and perform the operations around it.<\/p>\n<h2>Configure remote server details in the phpMyAdmin application config file<\/h2>\n<p>A configuration file <code>config.inc.php<\/code> is there for the phpMyAdmin application. Open that file and add the below settings into it.<\/p>\n<p>This setting is to add the remote database details, host, username, and password. The database port is optional if it is the default.<\/p>\n<p>Before setting the database details, it increments the existing config array index. We can add as many configurations as following the current batch of settings.<\/p>\n<pre class=\"prettyprint\"><code>$i++;\n$cfg['Servers'][$i]['host'] = 'DATABASE_HOST:PORT';\/\/set the database hostname.\n$cfg['Servers'][$i]['user'] = 'DATABASE_USER';\/\/ set the remote database user\n$cfg['Servers'][$i]['password'] = 'DATABASE_PASSWORD';\/\/ database password\n$cfg['Servers'][$i]['auth_type'] = 'config';\n<\/code><\/pre>\n<p>After adding these details, the phpMyAdmin application lists the configured database hostnames.<\/p>\n<p>The list is a dropdown of selectable database hosts that appears above the left navigation menu.<\/p>\n<p>The below figure shows the dropdown options of the current localhost and the RemoteHost server.<\/p>\n<p>It allows navigation between these two database servers to manage their assets.<\/p>\n<p><strong>Note:<\/strong> The RemoteHost:port is a test configuration data. Replace it with the remote database IP and port to be connected.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large wp-image-20582\" src=\"https:\/\/phppot.com\/wp-content\/uploads\/2023\/03\/phpmyadmin-remote-database-550x321.jpg\" alt=\"phpmyadmin remote database\" width=\"550\" height=\"321\" srcset=\"https:\/\/phppot.com\/wp-content\/uploads\/2023\/03\/phpmyadmin-remote-database-550x321.jpg 550w, https:\/\/phppot.com\/wp-content\/uploads\/2023\/03\/phpmyadmin-remote-database-300x175.jpg 300w, https:\/\/phppot.com\/wp-content\/uploads\/2023\/03\/phpmyadmin-remote-database-768x448.jpg 768w, https:\/\/phppot.com\/wp-content\/uploads\/2023\/03\/phpmyadmin-remote-database.jpg 1200w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\"><\/p>\n<p>These guidelines assume that you have the PHP and MySQL environment with the phpMyAdmin application installed.<\/p>\n<p>If you newly create the environment or install the phpMyAdmin, ensure the required privileges and security measures. We have seen steps to <a href=\"https:\/\/phppot.com\/mysql\/install-phpmyadmin-windows\/\">install phpMyAdmin on a windows<\/a> machine via the WAMP package installer.<\/p>\n<h2>Security measures needed for the machine connecting the remote database<\/h2>\n<h3>(1) Use a Linux environment<\/h3>\n<p>Before connecting the remote database via phpMyAdmin, we must be confident about the security.<\/p>\n<p>Linux-based machines are safe for proceeding with the remote connection.<\/p>\n<p>If you are using a Windows machine, there are settings to enable WSL to let it be secure while working with the remote database servers.<\/p>\n<h3>(2) Let login configuration empty<\/h3>\n<p>When setup the remote database server configuration, let the username and password empty.<\/p>\n<p>Set only the remote database server IP address to show in the phpMyAdmin web interface.<\/p>\n<p>Choosing the remote server to connect will redirect to the phpMyAdmin login panel to enter the details.<\/p>\n<h2>Directly access the remote phpMyAdmin web application URL<\/h2>\n<p>If you know the URL of the phpMyAdmin web application installed on the remote server, we can visit and land on its login page.<\/p>\n<p>The login page prompts the MySQL database host, username, and password. Entering and submitting these details allows access to the remote database.<\/p>\n<p>Thus, we have seen the possible ways of connecting the remote database server using the phpMyAdmin application.<\/p>\n<p> <!-- #comments --> <\/p>\n<div class=\"related-articles\">\n<h2>Popular Articles<\/h2>\n<\/p><\/div>\n<p> <a href=\"https:\/\/phppot.com\/mysql\/phpmyadmin-remote-database\/#top\" class=\"top\">\u2191 Back to Top<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>by Vincy. Last modified on March 16th, 2023. Do you want to connect a remote server from the phpMyAdmin installed on a local or test server? This article gives the steps needed to achieve it. There are many database clients, most of which support connecting a database server. But, working with phpMyAdmin to connect to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":132503,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[65],"tags":[],"class_list":["post-132502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-updates"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/132502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=132502"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/132502\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/132503"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=132502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=132502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=132502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}