Very persistent /opt/lampp/bin/mysql.server: 264: kill: No such process. Xampp/ubuntu 16.04

19,729

Solution 1

I know this is an 4 month old topic and seems no reply yet. And I actually met one of you problem too (xampp status shows mysql not running), so just list the solution here so that if someone run into a similar situation, hope this could help a bit.

So this is a very complicated problem.

Because from what you described (very detailed),there are still many possible causes to this problem.

QUESTION: So here are some question summarized for your (from my experience):

  1. Is your MySQL not running happened during your first startup (xampp start / xampp startmysql)?
  2. After installing xampp in Linux, have you customize MySQL configuration (default etc/my.cnf)?
  3. IF CUSTOMIZED Did you customize you database directory to a different location (default /opt/lampp/var/mysql)?
  4. IF NOT CUSTOMIZED As you mentioned you have access mysql command line, have you tried to SQL you database, or if the database was not even accessible (which means mysql server, named as mysqld, did not start properly)?
  5. Have you personally initialized/installed a mysql database (default bin/mysql_install_db)? Ok, these above questions should provide a basic trouble shooting idea.

SOLUTION:

1. error log problem

So this one should be the simpliest problem, and it could help us to better identify the error causes.

Check

a) in MySQL configuration (my.cnf) what is your running user? this should be a parameter under [mysqld] user=... (default mysql), we assume our configuration set to mysql

b) do you have an account for running user try terminal command id -u mysql, if it returns an id number, then the account exist, else it should tell you no such user. You need to have this user to run mysql server and write error log (by looking at the second part of your terminal record, your account should exist)

c) check your MySQL configuration (my.cnf) error log location, it should be under [mysqld] as a parameter log-error=... if this is not written, add to it (must be under [mysqld]).

d) check every directory of your log full path that (for example /var/log/mysql/error.log)

  • /var should have read and execute authority for mysql user (which is at least ******r-x) pass create file (execute) authority
  • /var/log should have read and execute authority for mysql user (which is at least ******r-x) pass create file (execute) authority
  • /var/log/mysql should have read, write and execute authority for mysql user (which is ******rwx) create and write file authority

So that your error.log file could be created here, if still not works, try to create it manually with owner as mysql, group as mysql and authority of 660.

2. MySQL server running status

there are several approaches to check this

a) use mysql.server (default bin/mysql.server) to do mysql.server status command. If your MySQL server is up running, it should show SUCCESS! MariaDB is running.

b) use top command to check if service is running, or use top | grep "mysqld". mysqld and mysqld_safe should in it.

c) login to mysql command line just like you did in terminal record 4 (this works part) and do command SHOW DATABASES; this should also work.

So my xampp 7.4.1 in centOS 8 gives a problem of mysql.server ... kill no such process error like you did. that is because the database could not startup. Even you could run mysql.server start, it would fail eventually. And it is simply because of a corrupted database. So our solution is to re-initialize (mysql_install_db) database file(s).

And also we run into plugin missing problem using mysql_install_db in Xampp. There are many search result on web, including changing core coding in xampp for a lower server version compatible control problem, but no luck. So the final way is to download an offical package of mysql and use the scripts/mysql_install_db to complete the task.

3. Customized database location cause Xampp mysql not running status This is a much deeper problem, because I have confirmed that MySQL server is running properly.

I did

[root@server ~]# /opt/lampp/xampp status
Version: XAMPP for Linux 7.4.1
Apache is running.
MySQL is not running.
ProFTPD is running.
[root@server ~]# /opt/lampp/bin/mysql.server status
SUCCESS! MariaDB running (xxxx)

So this shows that xampp is fetching service status incorrectly (like another post MySQL Database starts on Terminal But not on XAMPP )

I could trace down in detail how xampp works, but in /opt/lampp/xampp script file, I found /opt/lampp/share/xampp/status and /opt/lampp/share/statusraw

Go further into it (both /opt/lampp/share/xampp/status and /opt/lampp/share/statusraw file),

 /opt/lampp/var/mysql/` /bin/hostname`.pid mysqld

As my database was customized to localized directory, this means the pid file will not be in /opt/lampp/var/mysql, and this status will always return incorrectly.

So changing this into my own database pid location solved the problem.

Solution 2

Solution

  1. Step 1: check if the mysql service status

    service mysql status

as you can see, the service is already running.

  1. Step 2: stop the service using the command service mysql stop. you will be prompted to provide your password, just do it.

    service mysql stop

  2. Step 3: check mysql status again and verify that it is disabled

    service mysql status

  3. Step 4: Now all you need to do is start xampp normally using:

    sudo /opt/lampp/lampp start

Enjoy your day

Share:
19,729
user2943111
Author by

user2943111

Updated on June 06, 2022

Comments

  • user2943111
    user2943111 almost 2 years

    I installed XAMPP on Ubuntu. MySql-server fails to run properly.

    I tried many solutions, as suggested by google "/opt/lampp/bin/mysql.server 264 kill no such process", but to no avail.

    Username (root), database name and password in "config.inc.php" and wp-config.php are correct.

    richard@HAL:/opt/lampp$ ./lampp status
    Version: XAMPP for Linux 7.3.10-0
    Apache is running.
    MySQL is not running.  <- the problem
    ProFTPD is running.
    

    ===

    richard@HAL:/opt/lampp$ sudo ./lampp startmysql
    XAMPP: Starting MySQL...ok.
    richard@HAL:/opt/lampp$ /opt/lampp/bin/mysql.server: 264: kill: No such process
    

    ===

    root@HAL:/opt/lampp# service mysql stop
    root@HAL:/opt/lampp# ./lampp restart
    Restarting XAMPP for Linux 7.3.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.
    root@HAL:/opt/lampp# /opt/lampp/bin/mysql.server: 264: kill: No such process
    

    ===

    This works:

    root@HAL:/opt/lampp# mysql -p -u root -p
    Enter password: ***
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 193
    Server version: 5.7.28 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
    

    I can also access http://localhost/phpmyadmin and see the wp1 database for my wordpress1 project (which I still need to begin due to all issues)

    ===

    cd /var/log/mysql/ empty, no error.log (actually I deleted all in the process)

    ===

    I tried also to stop/restart via /etc/init.d

    Pressing start in ./manager-linux-x64.run shows MySQL in red after delay while trying to restart.

    I applied this: chmod a-wx ./etc/my.cnf and this:

    mysql -u root -p
    chmod -R 777 /opt/lampp
    chown -hR nobody /opt/lampp
    chmod -R 755 /opt/lampp
    sudo service mysql stop
    sudo /opt/lampp/lampp restart
    

    ===

    sudo netstat -nap | grep :80
    [sudo] password for richard: 
    tcp6       0      0 :::80                   :::*                    LISTEN      18825/httpd     
    tcp6       0      0 2a02:1811:bc1b:7c:33792 2a00:1450:400e:80b::443
    

    ===

    lsof -i :80 
    

    returns nothing

    ===

    Please tell me which commands I need to run for extra data you may need to diagnose the problem.

    Then what does this mysterious error 264 mean? BTW, I also checked similar issues with error 260, although I don't have that particular error.

    How can I systematically tune in on the root cause?

  • user2943111
    user2943111 about 4 years
    Hi, thanks for your answer. I think the problems occurred due to a conflict between MariaDB and MySql. I solved it the easiest way I could think of: I removed XAMP and installed LAMP stack. But like you said, your answer can help others.
  • Sudhakar Krishnan
    Sudhakar Krishnan about 4 years
    id -u mysql No user for me. So sudo adduser mysql and sudo chown -R mysql:mysql '/opt/lampp/share/mysql' and /var/mysql and /lib/mysql then delete all files from /temp . Then it worked for me.
  • user2943111
    user2943111 over 3 years
    Thanks, I will try that some day. At the time when I needed a solution, I just installed a LAMPP stack myself after removing XAMP. That is a lot more work, but it did the job. The problem seems to be caused by mixing mariadb with MySql.