I'm on MacOS (Catalina right now) but the issue has been there for the last couple of years.
XAMPP works great and then all of sudden I can't start MySQL. Only reinstalling XAMPP works every time, but this is really painful as I have many databases to dump. Also I'm a programmer and I became really tired of not knowing whats causing the issue.
So today it happened again and I decided this time I will at least try to figure it out.
MySQL is stuck at "Starting..." and changes to "Stopped" after roughly half a minute:
Trying to start processes from Terminal throws an error, that's kinda disturbing as it says "Starting MySQL...ok." and I'm getting "no such process" only after a few seconds. Looks like MySQL starts but then tries to do something, fails at it and then kills itself?
sh-3.2# ./xampp start
Starting XAMPP for Mac OS X 7.3.7-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
sh-3.2# /Applications/XAMPP/xamppfiles/bin/mysql.server: line 264: kill: (7260) - No such process
I decided to check what's on the 264 line of mysql.server and confirmed using echo that mysql runs that:
elif kill -0 $! ; then
: # mysqld_safe is still running
And here's the whole method:
wait_for_ready () {
i=0
while test $i -ne $service_startup_timeout ; do
if $bindir/mysqladmin ping >/dev/null 2>&1; then
log_success_msg
return 0
elif kill -0 $! ; then
: # mysqld_safe is still running
else
# mysqld_safe is no longer running, abort the wait loop
break
fi
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
done
log_failure_msg
return 1
}
Again, I'm not into desvops much but I'm pretty damn sure I should fall into first "if" and somehow I'm ending up in the "elif".
I tried these:
/Applications/XAMPP/xamppfiles/etc/my.cnf to anything else than 3305/3306,And nothing.
I've been googling the issue with "no such process" for an hour but without luck as well.
What's going on here and how could I fix that? Is there a way to go deeper and debug it properly? I feel like kill -0 $! tries to kill something that is not initiated yet and this wrecks the whole process, though I'm still not sure why.
Thanks a lot for any hints.