XAMPP MySQL server won't start on Mac OS High Sierra

A

Anonymous

Guest
Hello everyone,
I've spent several days on this problem, I've been searching every forum to see if anyone has a solution. I need to run an older version of XAMPP (5.6) and the MySQL server fails to start on Mac OS X. The XAMPP application manager will not start the MySQL server, so I used Terminal:

sudo /Applications/XAMPP/bin/mysql.server start

to force the server to run. But I got an error message:

"Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql
/Applications/XAMPP/xamppfiles/bin/mysqld_safe_helper: Can't create/write to file '/Applications/XAMPP/xamppfiles/var/mysql/UserName.local.err' (Errcode: 13 "Permission denied")
/Applications/XAMPP/bin/mysql.server: line 260: kill: (3256) - No such process
ERROR!"

Get the same error when logging into Terminal as ROOT.

The privileges for the "UserName.local.err" file was:

-rwxrwx--- 1 UserName admin 2500041 Oct 28 16:22 UserName-MacBook-Pro.local.err

So I gave the file all privileges - I will delete the entire XAMPP folder after printing out the SQL table structure and data. The privileges for the file are now:
-rwxrwxrwx 1 UserName admin 2500041 Oct 28 16:22 UserName-MacBook-Pro.local.err

The error message has now changed a bit:

"Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql
/Applications/XAMPP/bin/mysql.server: line 260: kill: (4738) - No such process
ERROR!"

Any idea as to getting this server to run? Thanks so much for your help!
Cheers,
Rick
 
Permissions can be quite confusing, your MySQL application runs under a user name and looking at the errors, it would seem that this may be the problem, does the MySQL application have permission to read and write to files?
 
Thank you very much, I thought it was a permissions problem. I cycled through this problem over and over again with fresh copies of the old XAMPP version. I tried one more time to re-install the app and to start the mysql.server and this time it worked. I would like to be able to share some insight as to how this happened, but I don't have a clue. It works now, thanks again!
Rick
 
  1. Check Ownership and Permissions: Make sure that the entire XAMPP installation directory, including subdirectories and files, is owned by your user account. You can use the following command to change ownership:
sudo chown -R UserName:admin /Applications/XAMPP


The error you're encountering seems to be related to file permission issues and the MySQL server not being able to create or write to certain files. Here are a few steps you can try to resolve this problem:

  1. Check Ownership and Permissions: Make sure that the entire XAMPP installation directory, including subdirectories and files, is owned by your user account. You can use the following command to change ownership:
bashCopy code
sudo chown -R UserName:admin /Applications/XAMPP

Replace "UserName" with your actual username.

  1. Adjust File Permissions: Reset the file permissions of the XAMPP files and directories by running the following commands:
sudo chmod -R 755 /Applications/XAMPP
sudo chmod -R 777 /Applications/XAMPP/xamppfiles/var/mysql

  1. Confirm the MySQL Data Directory: Verify that the MySQL data directory is set correctly in the my.cnf configuration file. Open the file /Applications/XAMPP/etc/my.cnf and ensure the datadir parameter is pointing to the correct directory:
datadir="/Applications/XAMPP/xamppfiles/var/mysql"

  1. Disable SELinux (if applicable): If you have SELinux enabled on your system, it could be causing permission issues. Temporarily disable SELinux by running the following command and then try starting the MySQL server again:
sudo setenforce 0

  1. Run MySQL as a Different User: Try starting the MySQL server with a different user by modifying the startup script. Open the file /Applications/XAMPP/bin/mysql.server and locate the line that starts with mysql_user. Change the value to a different user on your system that has appropriate permissions. For example:
mysql_user="your_username"

After applying these steps, try starting the MySQL server again using the Terminal command you mentioned:

sudo /Applications/XAMPP/bin/mysql.server start
 
Back
Top