无法启动 MySQL!在启动 XAMPP 时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12507358/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 14:54:51  来源:igfitidea点击:

Couldn't start MySQL! while starting XAMPP

mysqlsqldatabasexampp

提问by akhi

I am new in Ubuntu, I installed XAMPP in my Ubuntu 10.04. When I start XAMPP it says MySQL couldn't start.

我是 Ubuntu 新手,我在 Ubuntu 10.04 中安装了 XAMPP。当我启动 XAMPP 时,它说 MySQL 无法启动。

Here is my terminal ouput:

这是我的终端输出:

$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.0...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP for Linux started.

And then as I go to http://localhost, I got stuck on the XAMPP splash-screen, nothing happens if I choose language.

然后当我转到 时http://localhost,我卡在 XAMPP 启动画面上,如果我选择语言,则什么也不会发生。

采纳答案by akhi

I found the answer. First completly uninstall the lampp and then reinstall it. Before uninstalling, stop the lampp using the command:

我找到了答案。首先完全卸载lampp,然后重新安装它。在卸载之前,使用以下命令停止 lampp:

/opt/lampp/lampp stop

and then uninstall/remove it using the command

然后使用命令卸载/删除它

rm -rf /opt/lampp

then reinstall it.

然后重新安装它。

回答by Samrat Saha

This Worked For me as a Charm. [I used Ubuntu 12.04 and Xampp]

这对我很有用。[我使用了 Ubuntu 12.04 和 Xampp]

sudo chmod 755 /opt/lampp/etc/my.cnf

sudo chmod -R 777 /opt/lampp/var/mysql

sudo chown -hR root:root /opt/lampp

& Now Start Your Xampp

& 现在开始你的 Xampp

回答by laurent

It might just be that the /opt/lamppdoesn't have the right permissions. Before reinstalling everything, try running the commands below, it worked for me:

可能只是/opt/lampp没有正确的权限。在重新安装所有内容之前,请尝试运行以下命令,它对我有用:

sudo /opt/lampp/lampp stop
sudo chmod 755 /opt/lampp/etc/my.cnf
sudo chmod -R 777 /opt/lampp/var/mysql
sudo chown -hR root:root /opt/lampp
sudo /opt/lampp/lampp start

回答by ingscam

Just remove the version where the MySQL is not started with the command rm -rf /opt/lamppand the command:

用命令rm -rf /opt/lampp和命令删除没有启动MySQL的版本:

tar xvfz xampp-linux-1.8.1.tar.gz -C /opt

Replace xampp-linux-1.8.1.tar.gzwith your file name. After restarting your lampp, it will work fine.

替换xampp-linux-1.8.1.tar.gz为您的文件名。重新启动lampp后,它会正常工作。

回答by user1682315

You may not have completely removed your old lampp instance. Please remove it and install lampp once again.

您可能没有完全删除旧的 lampp 实例。请卸下它并重新安装 lampp。

回答by Kevin Chui

It might be the right permissionsproblem. Some solutions guide you to set it to 777which is not recommended. Try to set it to original permissions as installed. (especially after you restore from a tar without preserving the permissions)

这可能是正确的permissions问题。一些解决方案会指导您将其设置777为不推荐的。尝试将其设置为安装时的原始权限。(尤其是在不保留权限的情况下从 tar 恢复之后)

sudo /opt/lampp/lampp stop

sudo chown nobody.root /opt/lampp/var/mysql/cdcol /opt/lampp/var/mysql/mysql        /opt/lampp/var/mysql/phpmyadmin -R

sudo chown nobody.nogroup /opt/lampp/var/mysql/yourdbname -R

sudo /opt/lampp/lampp start

回答by vivekam79

Even I had the same issue. Always check for the error log before proceeding to find the root cause. Sometimes it could be file system space issue. In my case it was "/" file system was full. After clearing some space I was able to start the services without issues.

即使我有同样的问题。在继续查找根本原因之前,请务必检查错误日志。有时可能是文件系统空间问题。就我而言,它是“/”文件系统已满。清理一些空间后,我能够毫无问题地启动服务。

Thanks, Vishnu

谢谢,毗湿奴

回答by Arun Purohit

XAMPP started successfully on my side, but still got stuck at spalsh screen. It was solved by giving permission to lang.tmp file

XAMPP 在我这边成功启动,但仍然卡在 spalsh 屏幕上。它是通过授予 lang.tmp 文件权限解决的

sudo chmod 777 /opt/lampp/htdocs/xampp/lang.tmp

回答by Shahel

Your previous MySQL installation might be blocking your MySQL from the xampp bundle. I also had the same problem. Just uninstall the previous MySQL. Open the terminal(Ctrl ALt T) and paste the following code:

您之前的 MySQL 安装可能会阻止您的 MySQL 使用 xampp 包。我也有同样的问题。只需卸载以前的 MySQL。打开终端(Ctrl ALT T)并粘贴以下代码:

First stop XAMPP:

第一站 XAMPP:

sudo /opt/lampp/lampp stop

Uninstall MySQL:

卸载 MySQL:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

Start XAMPP:

启动 XAMPP:

sudo /opt/lampp/lampp start