简体   繁体   English

mysql 没有开始于 XAMPP UBUNTU

[英]mysql is not starting in XAMPP UBUNTU

I have one instance PHP and MySQL installed, now i am trying to install XAMPP on my system.我安装了一个实例 PHP 和 MySQL,现在我正在尝试在我的系统上安装 XAMPP。 I am able run the PHP of XAMPP. but while starting the service, i am getting the below error.我能够运行 XAMPP 的 PHP。但是在启动服务时,出现以下错误。 I want both the MySQl to be running by stopping the services of other.我希望通过停止其他服务来运行 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.

Please help, thanks请帮助,谢谢

If you're running ubuntu why on earth are you using XAMPP?如果你运行的是 ubuntu,你到底为什么要使用 XAMPP?

sudo apt-get install apache2 mysql-server phpmyadmin php5;

cd;mkdir www

pico /etc/apache2/sites-available/default

change document root to the www directory you just made which should be something like /home/yourusername/www/将文档根目录更改为您刚刚创建的 www 目录,该目录应该类似于 /home/yourusername/www/

service apache2 restart

Congratulations you're now running a full blown LAMP stack properly on a linux machine.恭喜你现在在 Linux 机器上正确运行了一个完整的 LAMP 堆栈。 http://localhost/ and http://localhost/phpmyadmin/ http://localhost/http://localhost/phpmyadmin/

All you have to do is stop Mysql and apache2 first你所要做的就是先停止Mysql和apache2

sudo service mysql stop
sudo /etc/init.d/apache2 stop

Then Start your然后开始你的

sudo /opt/lampp/lampp start
  1. Switch to the XAMPP installation directory.切换到 XAMPP 安装目录。 Type in输入

    cd /opt/lampp

    and press ↵ Enter然后按 ↵ Enter

  2. Enter the "Open" command.输入“打开”命令。 Type in输入

    sudo ./manager-linux-x64.run

    and press ↵ Enter然后按 ↵ Enter

Enter your password when prompted.出现提示时输入您的密码。 Type in the password you usually use to log into your computer, then press ↵ Enter.输入您通常用于登录计算机的密码,然后按 ↵ Enter。

This helped me...这帮助了我...

Following content is from MySQL Database cannot start on XAMPP for Mac以下内容来自MySQL 数据库无法在 XAMPP for Mac 上启动

1. Open XAMPP Installation Directory

2. Open "etc" Folder

3. Find "my.cnf" file and open it in any text editor

4. Change Port from 3306 to 3307 (if you have installed skype or other apps)

5. Add "innodb_force_recovery=1" under "myisam_sort_buffer_size=8M"

6. Save "my.cnf" file

7. Open xampp:-

8. Goto Computer(opt)> Open lampp folder(Search "lampp" if u can't see lampp folder)> Open manager-linux.run

9. In XAMPP Click on "Manage Server" Tab> Click on "Mysql Database"> Click on "Configure"> Change Port from 3306 to 3307> save and start the mysql database. 

You Get A message "Starting MySQL SUCCESS ! "您收到一条消息“启动 MySQL成功!”

All you have to do is stop Mysql and apache2 then restart them.您所要做的就是停止 Mysql 和 apache2,然后重新启动它们。

  1. Stop MySql and Apache2停止 MySql 和 Apache2

    sudo service mysql stop

    sudo /etc/init.d/apache2 stop

  2. Restart重新开始

    sudo /opt/lampp/lampp start

This should work这应该工作

Cheers干杯

If mysql is not starting in xampp, it might be a port conflict issue.如果 mysql 未在 xampp 中启动,则可能是端口冲突问题。 Mysql run by default on port 3306. you need to check if another application is occupying that port. Mysql 默认运行在 3306 端口。您需要检查是否有其他应用程序占用了该端口。 use following command to check app occupying a port使用以下命令检查应用程序占用端口

Linux: netstat -tulpn | grep 3306
Window: netstat -a -b

if you find an application occupying that port, stop the application and restart xampp.如果您发现某个应用程序占用了该端口,请停止该应用程序并重新启动 xampp。 As an alternative, you can go to php.ini file or click configure in the dropdown and change the mysql port to 3307或者,您可以转到 php.ini 文件或单击下拉列表中的配置并将 mysql 端口更改为 3307

Thanks for the answers.感谢您的回答。 I was tryin to start the mysql service when already one is already running.当已经有一个已经在运行时,我试图启动 mysql 服务。 Stop the instance of the mysql and apache before starting the XAMPP mysql and apache在启动 XAMPP mysql 和 apache 之前停止 mysql 和 apache 的实例

sudo service apache2 stop须藤服务 apache2 停止

sudo service mysql stop须藤服务 mysql 停止

then然后

sudo /opt/lampp/lampp start须藤 /opt/lampp/lampp 开始

I have a same problem.我有同样的问题。

my way is我的方式是

  1. backup your htdocs folder备份您的 htdocs 文件夹
  2. backup your database folder '/opt/lampp/var/mysql'备份您的数据库文件夹“/opt/lampp/var/mysql”
  3. check user on /opt/lampp/var/mysql $ ls -la检查 /opt/lampp/var/mysql $ ls -la 上的用户
  4. reinstall xampp full with delete data重新安装 xampp 并删除数据
  5. copy paste your database folder to /opt/lampp/var/mysql将您的数据库文件夹复制粘贴到 /opt/lampp/var/mysql
  6. change user access after paste on /opt/lampp/var/mysql all file and folder粘贴到 /opt/lampp/var/mysql 所有文件和文件夹后更改用户访问权限

to check user on folder检查文件夹上的用户

$ cd /opt/lampp/var/mysql
$ ls -la

to change user on folder for all files and folder更改所有文件和文件夹的文件夹用户

$ sudo chown -R mysql:mysql *

and 1 file based on your computer ex:和 1 个基于您的计算机的文件,例如:

$ sudo chown -R mysql:root emild-desktop.err

emild-desktop.err is log error of my pc emild-desktop.err 是我电脑的日志错误

  1. Copy Paste your htdocs folder on /opt/lampp将您的 htdocs 文件夹复制粘贴到 /opt/lampp

  2. Restart lampp service.重启 lampp 服务。

    $ sudo /opt/lampp/lampp start $ sudo /opt/lampp/lampp 开始

I've resolved in this way:我是这样解决的:

sudo chmod -R 777 /opt/lampp

sudo chown -hR nobody /opt/lampp
sudo chmod -R 755 /opt/lampp

i stop the other service running我停止其他服务运行

 sudo /etc/init.d/mysql start   

If apache and mysql datbase both stoped then run following commands如果 apache 和 mysql 数据库都停止,则运行以下命令

  1. sudo apachectl stop须藤 apachectl 停止

Stop MySql and Apache2停止 MySql 和 Apache2

  1. sudo service mysql stop须藤服务 mysql 停止

  2. sudo /etc/init.d/apache2 stop须藤 /etc/init.d/apache2 停止

Restart重新开始

  1. sudo /opt/lampp/lampp start须藤 /opt/lampp/lampp 开始

That works for me这对我行得通

This is the easiest fix that worked for me after trying a billion suggestions from various forums.在尝试了来自各种论坛的十亿条建议后,这是对我有用的最简单的修复方法。 First you need to update your kernel to the latest stable version, 3.19 (You really need to do this for it to work without any issues even in future (after updates)).首先,您需要将内核更新到最新的稳定版本 3.19(您确实需要这样做才能使其在将来(更新后)也能正常工作而不会出现任何问题)。

  1. Go to http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/转到http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/

  2. Look for the generic ones (ignore lowlatency)寻找通用的(忽略低延迟)

    • Download according to whether your comp is 64bit(amd64) or 32bit(i386);根据您的comp是64位(amd64)还是32位(i386)下载; there will be 2 files that you will be downloading.您将下载 2 个文件。 Remember to ignore the lowlatency ones.请记住忽略低延迟的。
    • Next, get this file also: linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb .. from the same place therefore making the total number of files that you will need to have to be 3.接下来,也获取此文件: linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb .. 来自同一个地方,因此您需要的文件总数必须为 3。
    • Install all the three files simply by double-clicking on their icons in your download directory只需双击下载目录中的图标即可安装所有三个文件

Install xampp directly from the apachefriends site: https://www.apachefriends.org/index.html直接从 apachefriends 站点安装 xampp: https ://www.apachefriends.org/index.html

Lastly, click on start all in the 'Manage Servers' tab and watch them all start, mysql database, Proftpd and Apache web server.最后,单击“管理服务器”选项卡中的全部启动并观看它们全部启动、mysql 数据库、Proftpd 和 Apache Web 服务器。 This also fixes the phpmyadmin (browser) error 2002.这也修复了 phpmyadmin(浏览器)错误 2002。

You may run,你可以跑,

sudo stop mysql须藤停止mysql

in terminal to stop mysql service and restart XAMPP.在终端中停止 mysql 服务并重新启动 XAMPP。

First of all you need to install gksu with the following command:首先,您需要使用以下命令安装 gksu:

sudo apt-get install gksu sudo apt-get install gksu

Then, run:然后,运行:

gksu gedit /usr/share/applications/xampp-control-panel.desktop and save the following code in the file. gksu gedit /usr/share/applications/xampp-control-panel.desktop并将以下代码保存在文件中。

(You are using 64 bit system so there is no need to change anything, simply do copy paste) (您使用的是 64 位系统,因此无需更改任何内容,只需复制粘贴即可)


[Desktop Entry] [桌面输入]

****Encoding=UTF-8 ****编码=UTF-8
Name=XAMPP Control Panel名称=XAMPP 控制面板
Comment=Start and Stop XAMPP注释=启动和停止 XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico图标=/opt/lampp/htdocs/favicon.ico
Categories=Application类别=应用
Type=Application类型=应用程序
Terminal=false****终端=假****

Note: For 32 bit xampp type "manager-linux.run" at place of "manager-linux-x64.run"注意:对于 32 位 xampp,在“manager-linux-x64.run”的位置键入“manager-linux.run”

Run following command in terminal:在终端中运行以下命令:

sudo apt-get update Now check applications, its icon has been created.You can get it from search sudo apt-get update现在检查应用程序,它的图标已经创建。您可以从搜索中获取

You can try this, it worked for me.你可以试试这个,它对我有用。

sudo /opt/lampp/lampp security

Ref: https://forums.linuxmint.com/viewtopic.php?t=246011参考: https : //forums.linuxmint.com/viewtopic.php? t =246011

I was able to resolve my issue when I found out that the service "mysqld" was running in parallel on port 3306.当我发现服务“mysqld”在端口 3306 上并行运行时,我能够解决我的问题。

I was able to find this information out by running "netstat -tulpn | grep 3306" in the terminal, which showed that "mysqld" was running.通过在终端中运行“netstat -tulpn | grep 3306”,我能够找到这些信息,这表明“mysqld”正在运行。 Which was suggested by @Adobe, thanks.这是@Adobe 建议的,谢谢。

I then ran "sudo service mysqld stop" and restarted the MySQL server on the XAMPP and it worked.然后我运行“sudo service mysqld stop”并在 XAMPP 上重新启动 MySQL 服务器并且它工作了。

If in your system already running the php and mysql then first you have to stop Mysql and apache2 then restart them using installed xampp.如果您的系统中已经运行了 php 和 mysql,那么首先您必须停止 Mysql 和 apache2,然后使用已安装的 xampp 重新启动它们。

First stop MySql and Apache2 from running system :首先停止 MySql 和 Apache2 运行系统:

#1 sudo service mysql stop

#2 sudo /etc/init.d/apache2 stop

Now restart the Xampp :现在重新启动 Xampp :

#1 sudo /opt/lampp/lampp start

Hope!希望! This will work for you.这对你有用。

You may install mysql default version.您可以安装 mysql 默认版本。 first, remove the MySQL server using the following command:首先,使用以下命令删除 MySQL 服务器:

sudo apt-get remove mysql-server
sudo apt-get autoremove

change your mysql port from 3306 to 3307 maybe 3306 is being used somewhere else将您的 mysql 端口从 3306 更改为 3307,也许 3306 正在其他地方使用

select Mysql server in the xampp app and select configure, in configure, change the port to 3307 to 3306.在xampp app中选择Mysql server并选择configure,在configure中将端口改为3307改为3306。

If it's not port conflict of 3306 with another service using the same port.如果不是 3306 与使用同一端口的其他服务的端口冲突。

sudo /opt/lampp/lampp stop

open /opt/lampp/etc/my.cnf打开/opt/lampp/etc/my.cnf

sudo nano /opt/lampp/etc/my.cnf

change user to your username/user-account then restart the server将用户更改为您的用户名/用户帐户,然后重新启动服务器

sudo /opt/lampp/lampp start

hope this helps希望这可以帮助

u need to add net tools by: sudo apt install net-tools您需要通过以下方式添加网络工具: sudo apt install net-tools

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM