Good question — this is a common problem when running XAMPP on a PC where MySQL (community server or Workbench install) is already installed.
👉 Both XAMPP’s MySQL (called MariaDB usually) and your standalone MySQL server will try to use port 3306, which leads to a port conflict.
📌 Two Solutions
1️⃣ Change XAMPP MySQL (MariaDB) Port
👉 Easiest way if you want to run both servers at the same time.
Steps:
- Open
XAMPP Control Panel. - Click Config button next to MySQL > open
my.ini. - Find:
[mysqld] port=3306 - Change to another port, e.g.
3307:port=3307 - Save and close
my.ini. - Start MySQL from XAMPP.
👉 Now XAMPP MySQL runs on port 3307, standalone MySQL still on 3306.
Access XAMPP MySQL:
- PHP code:
mysqli_connect(‘localhost’, ‘root’, ”, ‘dbname’, 3307); - phpMyAdmin:
Editxampp/phpMyAdmin/config.inc.php
$cfg[‘Servers’][$i][‘port’] = ‘3307’;
2️⃣ Stop Standalone MySQL When Using XAMPP
If you do not need both servers running together:
- Go to Windows Services (press Win+R → type
services.msc). - Find
MySQLservice (maybe calledMySQL80or similar). - Right click → Stop.
- Start MySQL from XAMPP (default port 3306 now free).
👉 Drawback: you need to stop/start services each time.
⚠️ Important Notes:
- XAMPP ships with MariaDB, fully compatible with MySQL.
- If you only want one MySQL instance, you can choose to disable or uninstall the other.
- Running both is perfectly fine, just use different ports.

Please watch this video:
[videopress 5PotyKqK]
When you have both XAMPP and a standalone MySQL server installed on the same computer, you may run into conflicts as both servers use the same default ports. To run MySQL in XAMPP, you will need to modify the default port number used by either the standalone MySQL server or the XAMPP MySQL server. Here are the steps you can follow:
These steps should allow you to run the MySQL server in XAMPP while avoiding conflicts with a standalone MySQL server.