How Can I Delete XAMPP Permanently on macOS?
Moving from XAMPP to MAMP on macOS is a common transition, but it often reveals why bundled distributions are risky for production-grade workflows or even serious local development. The scenario you describedâwhere data persists in a new installation after the old software appears deletedâis a classic symptom of incomplete uninstallation. Simply dragging the XAMPP folder to the Trash and running sudo rm -rf on the directory often leaves behind critical system-level artifacts, specifically database files and configuration directories that reside outside the main application bundle.
The root cause in your specific case is almost certainly residual MySQL data stored in the default system path. When XAMPP installs on macOS, it typically creates a database directory at /Applications/XAMPP/xamppfiles/, but depending on the installation wizard settings or manual configuration, it may also create a persistent data store at ~/Library/Application Support/XAMPP/ or even symlink to the global MySQL location if configured during setup. When you switched to MAMP and started writing to the database, your application likely inherited the default root password or connection string that pointed to an existing socket file or directory structure left over from XAMPP. If the new MAMP installation did not explicitly wipe the old data path, or if your .my.cnf (or my.ini) configuration on macOS still referenced the old socket location, MySQL would silently write to the old files while rejecting writes to the new ones, causing the "missing" data issue you observed.
To delete XAMPP permanently and ensure no residual data blocks your next environment, you must target three specific areas beyond the main application folder.
Remove Application Files and Data Stores
First, locate and remove the primary installation directory. If installed in the default location:
rm -rf /Applications/XAMPP/xamppfiles
However, this is rarely enough. XAMPP often drops configuration files and cached data into user libraries. You must explicitly remove these to prevent cross-contamination with your next web server stack (like MAMP or a native Nginx/PHP setup):
rm -rf ~/Library/Application\ Support/XAMPP
rm -rf ~/Library/Caches/XAMPP
Purge MySQL Data Directories
The most insidious part of the cleanup is the database directory. Even if you didn't change the default location, XAMPP may have registered paths in your global MySQL configuration (/etc/my.cnf or /usr/local/etc/my.cnf). If those paths still exist, your new server might be connecting to them by default.
Check for existing MySQL data directories that were created by XAMPP:
ls -ld /Library/mysql/data 2>/dev/null || echo "Global MySQL data not found"
ls -ld ~/Library/mysql/data 2>/dev/null || echo "User MySQL data not found"
If you find these directories, remove them. Be careful to ensure they aren't being actively used by a running mysqld process. Since MAMP is currently running and working as a web server, you should stop it before touching the data:
# Stop any existing MySQL instance
sudo killall -9 mysqld 2>/dev/null || sudo /Applications/MAMP/Library/bin/mysqladmin shutdown
Now, remove the specific XAMPP-created data directories if they exist:
rm -rf /Library/mysql/data
rm -rf ~/Library/mysql/data
Clean Up Configuration and Environment Variables
XAMPP often adds environment variables to your shell profile (.zshrc or .bash_profile). If you used the XAMPP control panel's path variables, removing the folder won't clear those references. Search for any lingering XAMPP paths:
grep -i "xampp" ~/.zshrc ~/.bash_profile 2>/dev/null
If found, edit the file and remove the lines. Also, check your .my.cnf or php.ini files within your project directories to ensure no hardcoded paths to /Applications/XAMPP/xamppfiles/ remain.
By meticulously removing these artifacts, you guarantee that MAMP (or any other stack) starts with a clean slate. This prevents the exact scenario where data is saved to an invisible, legacy directory while the new interface fails to reflect it.