[Tut] phpMyAdmin – How to Connect a Remote Database? - Printable Version +- Sick Gaming (https://www.sickgaming.net) +-- Forum: Programming (https://www.sickgaming.net/forum-76.html) +--- Forum: PHP Development (https://www.sickgaming.net/forum-82.html) +--- Thread: [Tut] phpMyAdmin – How to Connect a Remote Database? (/thread-100874.html) |
[Tut] phpMyAdmin – How to Connect a Remote Database? - xSicKxBot - 03-17-2023 phpMyAdmin – How to Connect a Remote Database? <div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2023/03/phpmyadmin-how-to-connect-a-remote-database.jpg" width="550" height="321" title="" alt="" /></div><div><div class="modified-on" readability="7.0909090909091"> by <a href="https://phppot.com/about/">Vincy</a>. Last modified on March 16th, 2023.</div> <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> <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> <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> <h2>Configure remote server details in the phpMyAdmin application config file</h2> <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> <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> <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> <pre class="prettyprint"><code>$i++; $cfg['Servers'][$i]['host'] = 'DATABASE_HOST:PORT';//set the database hostname. $cfg['Servers'][$i]['user'] = 'DATABASE_USER';// set the remote database user $cfg['Servers'][$i]['password'] = 'DATABASE_PASSWORD';// database password $cfg['Servers'][$i]['auth_type'] = 'config'; </code></pre> <p>After adding these details, the phpMyAdmin application lists the configured database hostnames.</p> <p>The list is a dropdown of selectable database hosts that appears above the left navigation menu.</p> <p>The below figure shows the dropdown options of the current localhost and the RemoteHost server.</p> <p>It allows navigation between these two database servers to manage their assets.</p> <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> <p><img 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="(max-width: 550px) 100vw, 550px"></p> <p>These guidelines assume that you have the PHP and MySQL environment with the phpMyAdmin application installed.</p> <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> <h2>Security measures needed for the machine connecting the remote database</h2> <h3>(1) Use a Linux environment</h3> <p>Before connecting the remote database via phpMyAdmin, we must be confident about the security.</p> <p>Linux-based machines are safe for proceeding with the remote connection.</p> <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> <h3>(2) Let login configuration empty</h3> <p>When setup the remote database server configuration, let the username and password empty.</p> <p>Set only the remote database server IP address to show in the phpMyAdmin web interface.</p> <p>Choosing the remote server to connect will redirect to the phpMyAdmin login panel to enter the details.</p> <h2>Directly access the remote phpMyAdmin web application URL</h2> <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> <p>The login page prompts the MySQL database host, username, and password. Entering and submitting these details allows access to the remote database.</p> <p>Thus, we have seen the possible ways of connecting the remote database server using the phpMyAdmin application.</p> <p> <!-- #comments --> </p> <div class="related-articles"> <h2>Popular Articles</h2> </p></div> <p> <a href="https://phppot.com/mysql/phpmyadmin-remote-database/#top" class="top">↑ Back to Top</a> </p> </div> https://www.sickgaming.net/blog/2023/03/16/phpmyadmin-how-to-connect-a-remote-database/ |