What are you looking for?
What are you looking for?
phpMyAdmin is a popular web-based tool bundled with XAMPP and Laragon that lets you manage MySQL databases easily. By default, phpMyAdmin connects to your local MySQL server, but you can also configure it to access a remote database server, just like you do in MySQL Workbench.
In both XAMPP and Laragon, phpMyAdmin settings are managed inside the
config.inc.php file.
C:\xampp\phpMyAdmin\config.inc.php
E:\laragon\etc\apps\phpMyAdmin\config.inc.php
Open config.inc.php in a code editor and add a new server
configuration block. Each server gets an incremented index ($i++).
$i++;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'your-remote-host.com'; // Remote DB host or IP
$cfg['Servers'][$i]['user'] = 'db_username'; // Remote DB user
$cfg['Servers'][$i]['password'] = 'db_password'; // Remote DB password
$cfg['Servers'][$i]['port'] = 3306; // Default MySQL port
$cfg['Servers'][$i]['ssl'] = false; // true if SSL is required
On the remote server, ensure MySQL is configured to accept remote connections. This usually requires two steps:
my.cnf
[mysqld]
bind-address = 0.0.0.0
GRANT ALL PRIVILEGES ON mydb.*
TO 'db_username'@'your.ip.address' IDENTIFIED BY 'db_password';
FLUSH PRIVILEGES;
'%' (all IPs) in production. Limit
access to specific IPs or use an SSH tunnel.
Restart Apache in XAMPP or Laragon, then open phpMyAdmin in your browser. You should now see an option in the dropdown to select your new remote server.
By editing config.inc.php, you can easily connect phpMyAdmin in
XAMPP or Laragon to a remote MySQL database. Always ensure your connection
is secure—prefer SSH tunneling or VPN when working with sensitive data over
the internet.