Page 1 of 1

[Fixed] "Couldn't start MySQL!"

PostPosted: 25. February 2013 21:05
by Tcherno
Hi!

I seem to have trouble starting MySQL. I've done a bit of research in this forum but I'm still a bit lost...
My configuration is:
- Ubuntu 12.04 LTS 32bits
- xampp 1.8.1

What happens in my terminal is this:
Code: Select all
lucien@lucien-AOD257:~$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
[b]XAMPP: Couldn't start MySQL![/b]
XAMPP: Starting ProFTPD...
XAMPP for Linux started.


EDIT: just skip this part, my first intuition was wrong. The solution is at the end of the post.

I looked into /opt/lampp/etc/my.cnf and found this :
[...]
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /opt/lampp/var/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
user = nobody
port = 3306
socket = /opt/lampp/var/mysql/mysql.sock
skip-external-locking
[...]


So I checked the directory/opt/lampp/var/mysql and there was no such document as "mysql.sock" (it was not hidden, I checked that too). I entered "mysql.sock" in the search engine and found nothing on my computer. I think that it might be the reason I can't MySQL.

There is one thing I did "my way" but I don't think it causes any issue: instead of using the terminal to extract the archive into /opt, I extracted the files into my Deskop, entered "sudo nautilus" in a terminal to open nautilus with administrator rights, and move the "lampp" directory into "/opt". When I start lampp and then access http://localhost I see the splashscreen but can't interact with it (because of the MySQL thing).

Can you help me and are the pieces of information I wrote here helpful? Thanks! :mrgreen:

EDIT: Solution
When the line "XAMPP: Couldn't start MySQL!" appears, the details are written in /opt/lampp/var/mysql/localhost.localdomain.err (the name of the file can be different, but the extensions is ".err". For me it was /opt/lampp/var/mysql/lucien-AOD257.err)

If you see some lines starting with "InnoDB", and things like "InnoDB: The error means mysqld does not have the access rights" etc. then it probably is a permission issue. To fix it, the owner of the files in /opt/lampp must be nobody:root (user:group).

Thank you JonB!
By the way, if I wrote something completely wrong in this solution, feel free to edit it 8)

Re: "Couldn't start MySQL!"

PostPosted: 25. February 2013 22:28
by JonB
you should check the MySQL error log -

/opt/lampp/var/mysql/localhost.localdomain.err

Also check the ownership of the files in /opt/lampp, The owner should be nobody:root (user:group)

BTW a socket is an object, not a file. (effectively it is a port) - thus you can't find it.

A Unix domain socket or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing within the same host operating system. While similar in functionality to named pipes, Unix domain sockets may be created as byte streams or as datagram sequences[clarify], while pipes are byte streams only. Processes using Unix domain sockets do not need to share a common ancestry. The API for Unix domain sockets is similar to that of an Internet socket, but it does not use an underlying network protocol for communication. The Unix domain socket facility is a standard component of POSIX operating systems.

Unix domain sockets use the file system as address name space. They are referenced by processes as inodes in the file system. This allows two processes to open the same socket in order to communicate. However, communication occurs entirely within the operating system kernel.

In addition to sending data, processes may send file descriptors across a Unix domain socket connection using the sendmsg() and recvmsg() system calls.

http://en.wikipedia.org/wiki/Unix_domain_socket

Good Luck

Re: "Couldn't start MySQL!"

PostPosted: 26. February 2013 09:04
by Tcherno
Thanks! I found the file, the name is a bit different (lucien-AOD257.err) but still contains useful informations. I'll try to fix my problem today and will reply later 8)

Re: "Couldn't start MySQL!"

PostPosted: 26. February 2013 10:08
by Tcherno
Hi again! I tried to fix it... and I failed :mrgreen:

The error log shows:
Can't open the mysql.plugin table. Please run mysql_upgrade to create it.


I enter:
Code: Select all
run mysql_upgrade

I get:
Le programme 'mysql_upgrade' n'est pas encore installé. Vous pouvez l'installer en tapant :
sudo apt-get install mysql-server-core-5.5

(sorry it's in french. I means: 'mysql_upgrade' is not instaled. You can instal it by typing: sudo apt-get install mysql-server-core-5.5)

I enter the following instructions (one instruction at a time):
Code: Select all
sudo apt-get install mysql-server-core-5.5
sudo apt-get install mysql-client-core-5.5
sudo /opt/lampp/lampp start


I get:
XAMPP: Couldn't start MySQL!


I looked into the error log, noticed a lot of "InnoDB" and thought "yes, it's a permission problem". I was going to post the log here when I asked myself: "wait, why is it obvious to me that it is a permission problem?" And I remembered: I read it here!! So I read your post again, set the ownership to nobody:root and started xampp. And you know what? It works, just like that :lol:

Thanks a lot! I'll modify my original post to write the solution.

Re: [Fixed] "Couldn't start MySQL!"

PostPosted: 26. February 2013 10:55
by JonB
OK - I am glad it has worked out for you...

Have fun with XAMPP

:D