php mysql 未在 XAMPP UBUNTU 中启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16830891/
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
mysql in not starting in XAMPP UBUNTU
提问by Infinity
I have one instance PHP and MySQL installed, now i am trying to install XAMPP on my system. I am able run the PHP of XAMPP. but while starting the service, i am getting the below error. I want both the MySQl to be running by stopping the services of other.
我安装了一个 PHP 和 MySQL 实例,现在我正在尝试在我的系统上安装 XAMPP。我可以运行 XAMPP 的 PHP。但是在启动服务时,我收到以下错误。我希望通过停止其他服务来运行 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
请帮忙,谢谢
回答by Dave
If you're running ubuntu why on earth are you using XAMPP?
如果你运行的是 ubuntu,你到底为什么要使用 XAMPP?
sudo apt-get install apache2 mysql-server phpmyadmin php5;
sudo apt-get install apache2 mysql-server phpmyadmin php5;
cd;mkdir www
cd;mkdir www
pico /etc/apache2/sites-available/default
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
service apache2 restart
Congratulations you're now running a full blown LAMP stack properly on a linux machine. http://localhost/
and http://localhost/phpmyadmin/
恭喜你现在在 Linux 机器上正确运行了一个完整的 LAMP 堆栈。 http://localhost/
和http://localhost/phpmyadmin/
回答by sandeep sahu
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成功!”
回答by Krishnashankar lodh
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
Switch to the XAMPP installation directory. Type in
cd /opt/lampp
and press ? Enter
Enter the "Open" command. Type in
sudo ./manager-linux-x64.run
and press ? Enter
切换到 XAMPP 安装目录。输入
cd /opt/lampp
并按?进入
输入“打开”命令。输入
sudo ./manager-linux-x64.run
并按?进入
Enter your password when prompted. Type in the password you usually use to log into your computer, then press ? Enter.
出现提示时输入您的密码。输入您通常用于登录计算机的密码,然后按 ? 进入。
回答by xreyc_developer22
All you have to do is stop Mysql and apache2 then restart them.
您所要做的就是停止 Mysql 和 apache2,然后重新启动它们。
Stop MySql and Apache2
sudo service mysql stop
sudo /etc/init.d/apache2 stop
Restart
sudo /opt/lampp/lampp start
停止 MySql 和 Apache2
sudo service mysql stop
sudo /etc/init.d/apache2 stop
重新开始
sudo /opt/lampp/lampp start
This should work
这应该工作
Cheers
干杯
回答by ABODE
If mysql is not starting in xampp, it might be a port conflict issue. Mysql run by default on port 3306. you need to check if another application is occupying that port. use following command to check app occupying a port
如果 mysql 未在 xampp 中启动,则可能是端口冲突问题。Mysql 默认运行在 3306 端口。您需要检查是否有其他应用程序占用了该端口。使用以下命令检查应用程序占用端口
Linux: netstat -tulpn | grep 3306
Window: netstat -a -b
if you find an application occupying that port, stop the application and restart xampp. As an alternative, you can go to php.ini file or click configure in the dropdown and change the mysql port to 3307
如果您发现某个应用程序占用了该端口,请停止该应用程序并重新启动 xampp。或者,您可以转到 php.ini 文件或单击下拉列表中的配置并将 mysql 端口更改为 3307
回答by emild_
I have a same problem.
我有同样的问题。
my way is
我的方式是
- backup your htdocs folder
- backup your database folder '/opt/lampp/var/mysql'
- check user on /opt/lampp/var/mysql $ ls -la
- reinstall xampp full with delete data
- copy paste your database folder to /opt/lampp/var/mysql
- change user access after paste on /opt/lampp/var/mysql all file and folder
- 备份您的 htdocs 文件夹
- 备份您的数据库文件夹“/opt/lampp/var/mysql”
- 检查 /opt/lampp/var/mysql $ ls -la 上的用户
- 重新安装 xampp 并删除数据
- 将您的数据库文件夹复制粘贴到 /opt/lampp/var/mysql
- 粘贴到 /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 是我电脑的日志错误
Copy Paste your htdocs folder on /opt/lampp
Restart lampp service.
$ sudo /opt/lampp/lampp start
将您的 htdocs 文件夹复制粘贴到 /opt/lampp
重启 lampp 服务。
$ sudo /opt/lampp/lampp 开始
回答by Deepak Nagar
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.desktopand 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
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false****
****Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
类型=应用程序
终端=假****
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 updateNow check applications, its icon has been created.You can get it from search
sudo apt-get update现在检查应用程序,它的图标已经创建。您可以从搜索中获取
回答by joe
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(您确实需要这样做才能使其在将来(更新后)也能正常工作而不会出现任何问题)。
Go to http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/
Look for the generic ones (ignore lowlatency)
- Download according to whether your comp is 64bit(amd64) or 32bit(i386); there will be 2 files that you will be downloading. 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.
- Install all the three files simply by double-clicking on their icons in your download directory
转到http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/
寻找通用的(忽略低延迟)
- 根据您的comp是64位(amd64)还是32位(i386)下载;您将下载 2 个文件。请记住忽略低延迟的。
- 接下来,也获取此文件:linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb.. 来自同一个地方,因此您需要的文件总数必须为 3。
- 只需双击下载目录中的图标即可安装所有三个文件
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. This also fixes the phpmyadmin (browser) error 2002.
最后,单击“管理服务器”选项卡中的全部启动并观看它们全部启动、mysql 数据库、Proftpd 和 Apache Web 服务器。这也修复了 phpmyadmin(浏览器)错误 2002。
回答by Infinity
Thanks for the answers. I was tryin to start the mysql service when already one is already running. Stop the instance of the mysql and apache before starting the XAMPP mysql and apache
感谢您的回答。当已经有一个已经在运行时,我试图启动 mysql 服务。在启动 XAMPP mysql 和 apache 之前停止 mysql 和 apache 的实例
sudo service apache2 stop
须藤服务 apache2 停止
sudo service mysql stop
须藤服务 mysql 停止
then
然后
sudo /opt/lampp/lampp start
须藤 /opt/lampp/lampp 开始
回答by Sakuni Manamendra
You may run,
你可以跑,
sudo stop mysql
须藤停止mysql
in terminal to stop mysql service and restart XAMPP.
在终端中停止 mysql 服务并重新启动 XAMPP。