首页 > 解决方案 > 在 Ubuntu 18.04 中启动 Xampp 时遇到 MySQL 错误

问题描述

我在 ubuntu 中的 xampp 工作得很好,直到它突然停止工作,当我重新安装它并通过命令行启动它时,它向我显示了这个错误“opt/lampp/bin/mysql.server: 260: kill: No such process “开始后。

我在我的 localhost/phpmyadmin 上也遇到了这个错误

MySQL said: Documentation
Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/2002): No such file or directory
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): No such file or directory
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

标签: ubuntuxampp

解决方案


该错误很可能是权限问题,没有来自mysql的错误日志,即使sudo chmod -R /opt/lampp工作但我认为制作/opt/lampp/777不是一个好主意,所以我对原始答案进行了一些改进:

  1. sudo chmod 777 /opt/lampp/var/
  2. sudo chown -R mysql:mysql /opt/lampp/var/mysql/
  3. sudo lampp restart

推荐阅读