Infinity
Infinity

Reputation: 561

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

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

Upvotes: 19

Views: 115134

Answers (20)

Umair.A
Umair.A

Reputation: 9

My problem was solved with this simple method:

  1. paste this command in the terminal sudo/opt/lampp/manager-linux-x64.run
  2. stop all the services
  3. go to the MySQL database cofing button
  4. change the port from 3306 to 3307
  5. Now run all
  6. now everything will work fine

Upvotes: -1

shyakadev
shyakadev

Reputation: 49

If it's not port conflict of 3306 with another service using the same port.

sudo /opt/lampp/lampp stop

open /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

Upvotes: 0

mdminhaziftekhar
mdminhaziftekhar

Reputation: 1

select Mysql server in the xampp app and select configure, in configure, change the port to 3307 to 3306.

Upvotes: 0

Jacobkyalo
Jacobkyalo

Reputation: 1

change your mysql port from 3306 to 3307 maybe 3306 is being used somewhere else

Upvotes: 0

MD SHAYON
MD SHAYON

Reputation: 8051

You may install mysql default version. first, remove the MySQL server using the following command:

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

Upvotes: 0

Muhammad Noman
Muhammad Noman

Reputation: 21

If apache and mysql datbase both stoped then run following commands

  1. sudo apachectl stop

Stop MySql and Apache2

  1. sudo service mysql stop

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

Restart

  1. sudo /opt/lampp/lampp start

That works for me

Upvotes: 2

Nilesh Patil
Nilesh Patil

Reputation: 41

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.

First stop MySql and Apache2 from running system :

#1 sudo service mysql stop

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

Now restart the Xampp :

#1 sudo /opt/lampp/lampp start

Hope! This will work for you.

Upvotes: 0

Marvin Dawson
Marvin Dawson

Reputation: 69

I was able to resolve my issue when I found out that the service "mysqld" was running in parallel on port 3306.

I was able to find this information out by running "netstat -tulpn | grep 3306" in the terminal, which showed that "mysqld" was running. Which was suggested by @Adobe, thanks.

I then ran "sudo service mysqld stop" and restarted the MySQL server on the XAMPP and it worked.

Upvotes: 0

Satyam Rai
Satyam Rai

Reputation: 401

You can try this, it worked for me.

sudo /opt/lampp/lampp security

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

Upvotes: 1

xreyc
xreyc

Reputation: 221

All you have to do is stop Mysql and apache2 then restart them.

  1. Stop MySql and Apache2

    sudo service mysql stop

    sudo /etc/init.d/apache2 stop

  2. Restart

    sudo /opt/lampp/lampp start

This should work

Cheers

Upvotes: 11

ABODE
ABODE

Reputation: 1018

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

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

Upvotes: 6

Kashif
Kashif

Reputation: 1454

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   

Upvotes: 1

Krishnashankar lodh
Krishnashankar lodh

Reputation: 361

All you have to do is stop Mysql and apache2 first

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. Type in

    cd /opt/lampp
    

    and press ↵ Enter

  2. Enter the "Open" command. Type in

    sudo ./manager-linux-x64.run
    

    and press ↵ Enter

Enter your password when prompted. Type in the password you usually use to log into your computer, then press ↵ Enter.

Upvotes: 36

Deepak Nagar
Deepak Nagar

Reputation: 39

First of all you need to install gksu with the following command:

sudo apt-get install gksu

Then, run:

gksu gedit /usr/share/applications/xampp-control-panel.desktop and save the following code in the file.

(You are using 64 bit system so there is no need to change anything, simply do copy paste)


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

Note: For 32 bit xampp type "manager-linux.run" at place of "manager-linux-x64.run"

Run following command in terminal:

sudo apt-get update Now check applications, its icon has been created.You can get it from search

Upvotes: 0

sandeep sahu
sandeep sahu

Reputation: 151

This helped me...

Following content is from MySQL Database cannot start on 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! "

Upvotes: 15

joe
joe

Reputation: 9

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

  1. Go to 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); 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

Install xampp directly from the apachefriends site: 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.

Upvotes: 0

emild_
emild_

Reputation: 93

I have a same problem.

my way is

  1. backup your htdocs folder
  2. backup your database folder '/opt/lampp/var/mysql'
  3. check user on /opt/lampp/var/mysql $ ls -la
  4. reinstall xampp full with delete data
  5. copy paste your database folder to /opt/lampp/var/mysql
  6. change user access after paste on /opt/lampp/var/mysql all file and folder

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:

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

emild-desktop.err is log error of my pc

  1. Copy Paste your htdocs folder on /opt/lampp

  2. Restart lampp service.

    $ sudo /opt/lampp/lampp start

Upvotes: 2

Sakuni Manamendra
Sakuni Manamendra

Reputation: 59

You may run,

sudo stop mysql

in terminal to stop mysql service and restart XAMPP.

Upvotes: 0

Infinity
Infinity

Reputation: 561

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

sudo service apache2 stop

sudo service mysql stop

then

sudo /opt/lampp/lampp start

Upvotes: 6

Dave
Dave

Reputation: 3288

If you're running ubuntu why on earth are you using 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/

service apache2 restart

Congratulations you're now running a full blown LAMP stack properly on a linux machine. http://localhost/ and http://localhost/phpmyadmin/

Upvotes: 20

Related Questions