非常持久的/opt/lampp/bin/mysql.server: 264: kill: 没有这样的进程.Xampp/Ubuntu 16.04 [英] Very persistent /opt/lampp/bin/mysql.server: 264: kill: No such process. Xampp/ubuntu 16.04

查看:48
本文介绍了非常持久的/opt/lampp/bin/mysql.server: 264: kill: 没有这样的进程.Xampp/Ubuntu 16.04的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 上安装了 XAMPP.MySql-server 无法正常运行.

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

我尝试了很多解决方案,如谷歌建议的/opt/lampp/bin/mysql.server 264 kill no such process",但无济于事.

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

"config.inc.php" 和 wp-config.php 中的用户名 (root)、数据库名和密码正确.

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

===

这有效:

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.

我还可以访问 http://localhost/phpmyadmin 并查看我的 wordpress1 项目的 wp1 数据库(我由于所有问题仍然需要开始)

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/空,没有error.log(其实过程中我都删了)

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

===

我也尝试通过/etc/init.d 停止/重启

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

在尝试重新启动时,在 ./manager-linux-x64.run 中按开始在延迟后将 MySQL 显示为红色.

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

我应用了这个:chmod a-wx ./etc/my.cnf还有这个:

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 

什么都不返回

===

请告诉我我需要运行哪些命令来获取诊断问题所需的额外数据.

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

那么这个神秘的错误 264 是什么意思呢?顺便说一句,我还检查了错误 260 的类似问题,尽管我没有那个特定的错误.

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?

推荐答案

我知道这是一个 4 个月前的话题,似乎还没有回复.而且我实际上也遇到了你们中的一个问题(xampp 状态显示 mysql 未运行),因此只需在此处列出解决方案,以便如果有人遇到类似情况,希望这能有所帮助.

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. 您的 MySQL 未运行 是否在您第一次启动时发生 (xampp start/xampp startmysql)?
  2. 在 Linux 中安装 xampp 后,您是否自定义了 MySQL 配置(默认为 etc/my.cnf)?
  3. IF CUSTOMIZED 您是否将数据库目录自定义到其他位置(默认/opt/lampp/var/mysql)?
  4. 如果不是自定义的 正如您提到的,您可以访问 mysql 命令行,您是否尝试过 SQL 您的数据库,或者甚至无法访问该数据库(这意味着名为 mysqld 的 mysql 服务器,无法正常启动)?
  5. 您是否亲自初始化/安装了 mysql 数据库(默认 bin/mysql_install_db)?好的,以上这些问题应该提供了一个基本的故障排除思路.
  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.

解决方案:

1.错误日志问题

所以这个应该是最简单的问题,它可以帮助我们更好地识别错误原因.

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

检查

a) 在 MySQL 配置 (my.cnf) 中,您的运行用户是什么?这应该是 [mysqld] user=... (默认 mysql) 下的一个参数,我们假设我们的配置设置为 mysql

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) 你有运行用户 try 终端命令 id -u mysql 的账户,如果它返回一个 id 号,那么该账户存在,否则它应该告诉你 no such用户.你需要让这个用户运行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) 检查你的 MySQL 配置(my.cnf)错误日志位置,应该在 [mysqld] 下作为参数 log-error=... 如果没有写,添加进去(必须在 [mysqld] 下]).

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) 检查日志完整路径的每个目录(例如/var/log/mysql/error.log)

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

  • /var 应该有 readexecute 权限给 mysql 用户(至少是 ******rx)pass create file(execute)权限
  • /var/log 应该有mysql用户的readexecute权限(至少是******rx)pass create file(execute)权限
  • /var/log/mysql 应该有 mysql 用户的 readwriteexecute 权限(即 ******rwx) 创建和写入文件权限
  • /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

这样你的error.log文件就可以在这里创建了,如果还是不行,尝试手动创建,所有者为mysql,组为mysql,权限为660.

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服务器运行状态

有几种方法可以检查这一点

there are several approaches to check this

a) 使用 mysql.server (默认 bin/mysql.server) 做 mysql.server status 命令.如果您的 MySQL 服务器正在运行,它应该显示 SUCCESS!MariaDB 正在运行.

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) 使用 top 命令检查服务是否正在运行,或者使用 top |grepmysqld".mysqldmysqld_safe 应该在里面.

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

c) 像在终端记录 4 中所做的那样登录到 mysql 命令行(这是有效的部分)并执行命令 SHOW DATABASES; 这也应该有效.

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.

所以我在 centOS 8 中的 xampp 7.4.1 出现了 mysql.server ... kill no such process 像你一样的错误.那是因为数据库无法启动.即使你可以运行 mysql.server start,它最终也会失败.这仅仅是因为数据库损坏.所以我们的解决方案是重新初始化(mysql_install_db)数据库文件.

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

而且我们在 Xampp 中使用 mysql_install_db 时遇到了插件丢失问题.网上有很多搜索结果,包括更改xampp中的核心编码以解决较低服务器版本兼容的控制问题,但没有运气.所以最后的办法就是下载一个官方的mysql包,使用scripts/mysql_install_db来完成任务.

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.自定义数据库位置导致Xampp mysql没有运行状态这是一个更深层次的问题,因为我已经确认 MySQL 服务器运行正常.

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.

我做到了

[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)

所以这表明 xampp 正在错误地获取服务状态(就像另一篇文章 MySQL 数据库在终端上启动,但不在 XAMPP 上 )

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

我可以详细追踪 xampp 的工作原理,但是在 /opt/lampp/xampp 脚本文件中,我找到了 /opt/lampp/share/xampp/status/opt/lampp/share/statusraw

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

进一步研究(/opt/lampp/share/xampp/status/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

由于我的数据库是自定义到本地化目录,这意味着pid文件不会在/opt/lampp/var/mysql中,并且此状态将始终错误返回.

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.

因此将其更改为我自己的数据库 pid 位置解决了问题.

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

这篇关于非常持久的/opt/lampp/bin/mysql.server: 264: kill: 没有这样的进程.Xampp/Ubuntu 16.04的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆