Fix XAMPP mysql start issue: /opt/lampp/bin/mysql.server: 264: kill: No such process

2020年09月24日 9171Browse 3Like 1Comments

I aliased the xampp start script in my shell rc file, so lamp in the below means sudo /opt/lampp/lampp, I am using Linux, while on Mac, the script locates at /Applications/XAMPP/xamppfiles/xampp

Mysql start issue

$ lamp start
Starting XAMPP for Linux 7.4.10-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

It started MySQL at first, after a second or two, it reported mysql daemon is terminated:

$ /opt/lampp/bin/mysql.server: 264: kill: No such process

Fix

Way 1: Change the default mysql service port

Edit mysql configuration file, find [mysqld] section (not the [client] section), change the default port number 3306 to another value.

$sudo vim /opt/lampp/etc/my.cnf 
[mysqld]
user=mysql
port=3306  # change this default port to other number, like 3406

Or use the GUI tool to change:

$ cd /opt/lampp
$ sudo ./manager-linux-x64.run

Way 2: Terminate the process taking port 3306

$ sudo lsof -i:3306
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
docker-proxy 2557 root    4u  IPv4  57867      0t0  TCP localhost:mysql (LISTEN)
$ sudo pkill docker-proxy

The reason why I cannot start mysql is due to I am running a mysql docker container which has already taken the port. So I am not able to start XAMPP's mysql before I kill the docker-proxy process or stop mysql container.

$ lamp restart
Restarting XAMPP for Linux 7.4.10-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.


Other XAMPP start issues and solutions

As a matter of fact, all these issues are related to ports confliction:

1. XAMPP: Another Web Server is already running.
If you run Xampp on Ubuntu, you may have apache2 installed and started by default, so:

	$ sudo /etc/init.d/apache2 stop && sudo update-rc.d apache2 disable
	$ # or run: 
	$ sudo systemctl stop apache2 && sudo systemctl disable apache2
 $ lamp restart

Or just change the Xampp's apache service default ports to other values instead of 80(http) and 443(https).

	$ sudo vim /opt/lampp/etc/httpd.conf   # change the default Listen port from 80 to some other
	$ sudo vim /opt/lampp/etc/extra/httpd-ssl.conf   # change the default Listen port from 443 to some other
	$ sudo vim /opt/lampp/xampp # change testport 80/443 to the number you modified above

2. XAMPP: Another FTP daemon is already running

	$ sudo vim /opt/lampp/etc/proftpd.conf    # change the default Listen port from 21 to some other
	$ sudo vim /opt/lampp/xampp # change testport 21 to the number you modified above

Sunflower

Stay hungry stay foolish

Comments

  • Yuri2397

    Run:

    sudo service mysql stop
    sudo xampp start

    2021年05月26日