skip to Main Content

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.

3

Answers


  1. 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

    Login or Signup to reply.
  2. Type the following two commands:

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

    I hope it works good.

    Login or Signup to reply.
  3. Just try this:

    enter image description here

    Open terminal from Xampp -> enter apt-get update then -> enterapt-get install nano then -> navigated to mysql folder cd ../opt/lampp/var/mysql -> delete these files rm ib_logfile0 enter and -> rm ib_logfile1 enter

    now restart Xampp.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search