XAMPP MySQL not starting: /opt/lampp/bin/mysql.server: 263: kill: No such process

Viewed 2165

When I launch XAMPP, apache works fine but mysql doesn't start, it always say:
'Failed to start "mysql": cannot start service: /opt/lampp/bin/mysql.server: 263: kill: No such process' It is weird because before, everything was working great, and one time, while working on my project, I sent an sql request from php and after when I refreshed phpmyadmin, my database wouldn't show. I restarted XAMPP and mysql wouldn't start again. The sql request from php was looking like this:

$sql = "UPDATE courses_messages SET message=? WHERE id=?;";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
    header("Location: ../error.php");
    exit();
}
else {
    mysqli_stmt_bind_param($stmt, "si", $newQues, $quesId);
    mysqli_stmt_execute($stmt);
    header("Location: ../course.php?courseid=".$courseIdFromGet."&change=success".$quesId);
    exit();
}

I am using a MacBook Air and while this happened I was on Big Sur but just today I updated to Monterey and no difference.

2 Answers

Are you sure your mysql located at /opt/lampp/bin/mysql.server ? I'm using MacOX too. If I install by default, the sql is in folder "application/XAMPP/xamppfiles/bin" For me, the faster to solved the problem is backup all your files and database and reinstall a fresh new XAMPP

Type the following two commands:

sudo service mysql stop
sudo /opt/lampp/lampp start

I hope it works good.

Related