MySQL is not ruuning when i start in the Xampp Control panel

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

MySQL is not ruuning when i start in the Xampp Control panel

Postby anand » 13. February 2007 11:30

Below is the message that is displayed in the control panel. When i start all services i see that MySQL is the only one that is not running. Could you please advise

Starting XAMPP for MacOS X 0.6a...
XAMPP: XAMPP-Apache is already running.
XAMPP: Starting MySQL...
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for MacOS X started.

Thanks
Anand
anand
 
Posts: 6
Joined: 23. December 2006 05:08
Location: Kuala Lumpur

MySQL

Postby anand » 14. February 2007 03:24

Yes i have started the server, i am using the Xampp control panel to start all services, but i see that everything else is running except for MySQL
anand
 
Posts: 6
Joined: 23. December 2006 05:08
Location: Kuala Lumpur

Similiar issue

Postby vchmielewski » 23. February 2007 19:55

I'm having difficulty getting my MySQL running as well. When I try to start it from the command line, I get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/xampp/xamppfiles/var/mysql/mysql.sock' (2)

I suspect that part of my problem is that I already had MySQL installed prior to installing XAMPP. I removed the old directory, but must be missing something.

Anyone have any suggestions?
vchmielewski
 
Posts: 1
Joined: 23. February 2007 19:52
Location: Ann Arbor, MI USA

Postby mistermartin75 » 02. March 2007 19:08

How did you install XAMPP? Did you extract the package with the command or by double clicking?
mistermartin75
 
Posts: 30
Joined: 02. November 2005 09:50

Postby tachu » 02. March 2007 20:30

im having the same problem after I upgraded to the last version.. I extracted by double clicking.
tachu
 
Posts: 11
Joined: 23. May 2006 22:46

Postby Kristian Marcroft » 04. March 2007 23:19

tachu wrote:im having the same problem after I upgraded to the last version.. I extracted by double clicking.


Dear Sir,

thats the exact false way to install XAMPP.
Please follow the instructions on our webpage for correct installation.

Regards,

P.S: If there is someone out there that can help us create an "Installer Package" we would appreciate it if this person contacted us. Thanks :)
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby tachu » 05. March 2007 01:40

Ok I reinstalled following those instructions. It fixed some other problems but MySQL still won't work.
tachu
 
Posts: 11
Joined: 23. May 2006 22:46

Postby vanderaj » 05. March 2007 03:09

It's because the permissions to the socket file are too tight:

Code: Select all
[slightlybent:xampp/xamppfiles/bin] vanderaj% ./mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/xampp/xamppfiles/var/mysql/mysql.sock' (13)

[slightlybent:xampp/xamppfiles/bin] vanderaj% sudo ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.33 Source distribution


So, connecting as root does the trick so it's a permission problem.

To resolve this, you need to open up access /Application/xammp/xammpfiles/var/mysql/mysql.sock a bit to avoid running everything to do with mysql as root or using sudo all the time.

mysqld runs as nobody, so that's the user that needs to be the owner of the files under var/mysql. We su as "admin" not wheel, but wheel is sorta equivalent. In any case, when you start xammp using sudo or the Control Panel, you get gid = admin, so that should be the group.

So, how to fix? Here you go:

Code: Select all
[slightlybent:~] vanderaj% cd /Applications/xampp/xamppfiles/var
[slightlybent:xampp/xamppfiles/var] vanderaj% sudo chown -R nobody.admin mysql/
Password:
chown: separation of user and group with a period is deprecated
[slightlybent:xampp/xamppfiles/var] vanderaj% sudo chmod -R ug=rwX,o=rX mysql/

[slightlybent:xampp/xamppfiles/var] vanderaj% sudo /Applications/xampp/xamppfiles/mampp restart
Stopping XAMPP for MacOS X 0.6.1...
XAMPP: Stopping Apache...
XAMPP: Stopping MySQL...
XAMPP stopped.
Starting XAMPP for MacOS X 0.6.1...
XAMPP: Starting Apache...
XAMPP: Starting MySQL...
XAMPP for MacOS X started.
[slightlybent:xampp/xamppfiles/var] vanderaj% /Applications/xampp/xamppfiles/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.33 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


Can the permissions please be fixed in the next release of xammp for MacOS X?

thanks,
Andrew
OWASP Guide Project Lead :: http://www.owasp.org/
UltimaBB Lead Developer and Security Dude :: http://www.ultimabb.com/
Aussieveedubbers :: http://forums.aussieveedubbers.com/
vanderaj
 
Posts: 4
Joined: 17. February 2005 05:56
Location: Melbourne, Australia

Postby tachu » 05. March 2007 14:51

hey thanks so much it now works fine :P
tachu
 
Posts: 11
Joined: 23. May 2006 22:46

Postby vanderaj » 05. March 2007 18:46

There are two potential long term solutions...

1. Move the socket somewhere relative to its risk

var/mysql contains the databases, and seriously, the socket probably does not belong in there, but in /tmp or /private/tmp

The function of the socket is to allow local clients to access the database, so the location of the socket should be shared locally. Historically, that's /tmp on Unix systems.

2. Create a low privilege directory inside var/mysql to allow the socket to be readable by any local user, but protect the rest of the (actually secure) details.

Lastly, running the mysqld as nobody is not such a great idea. The keys to the kingdom are at risk, as usually there is too much running as nobody, so it is actually a powerful group.

There should be a separate mysqld user, and there is already a mysql group (gid 74). However, as the control panel runs with elevated privileges, the directory group should be wheel, not mysqld.

Andrew
OWASP Guide Project Lead :: http://www.owasp.org/
UltimaBB Lead Developer and Security Dude :: http://www.ultimabb.com/
Aussieveedubbers :: http://forums.aussieveedubbers.com/
vanderaj
 
Posts: 4
Joined: 17. February 2005 05:56
Location: Melbourne, Australia

Postby Kristian Marcroft » 05. March 2007 18:58

Hi all,

I actually don't really see a security issue having the sock file in the same directory as the database files. We are very aware of the current problem, however only have very limited time.

We do not really want to use any system internal users or groups such as "mysql", as we can not guearantee these users and groups exists on every system. Apple changes this from release to release.

What we are currently working on is a kind of "setup"-Script which should after successfully installing XAMPP and executing it for the first time check all permissions and correct them if required.

As we are open source, anyone may contribute to the project. We are very happy for every piece of software and code snippets. Just register an account at http://bugs.xampp.org and you may start contributing. Currently the OS X version of XAMPP is only maintained by PF4 (Florian Pollini) and myself "KriS" (Kristian Marcroft).

We are looking for people that actually know their way around creating installers and have very good MacOS X knowlege. Even users with not as good knowlege are welcome to contribute.

Of course participants that contribute will be credited in the Releasenotes etc.

Thanks
Kristian Marcroft
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby AngryRobotto » 05. March 2007 19:17

If I knew how to program, i'd help.

It would definatly be nice having the program automatically install.
I am the angry english-speaking robot
AngryRobotto
 
Posts: 9
Joined: 03. March 2007 00:00

Postby iwonder » 18. March 2007 20:28

I tried the vanderaj , but in the last step it gave me this error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/xampp/xamppfiles/var/mysql/mysql.sock' (13)
iwonder
 
Posts: 8
Joined: 09. August 2005 03:14

Postby tantrik » 31. March 2007 20:27

HI, I am new to xampp & mac, and having the same problem, I already had mysql installed on my system and so I deleted it. (just dragged in into trash, I don't know if i have to do anything else i mean with references) I installed xampp then and I am facing the same problem starting mysql, So after going through this post I found that my mysql.sock is supposed to be in var/mysql but instead it was in /tmp so i moved it to var/mysql, and then followed vanderaj's instructions(as a root, I always use it as a root due to permission problems), It worked once and when I tried again It gave the same error, so when I checked my var/mysql for mysql.sock It was no longer there. I removed and reinstalled xampp hoping to see mysql.sock in either of places but it wasn't there. even my proftpd is not running. And also instead of xampp getting installed in the existing application folder it creates a new application folder, that is visible when i click macosdisk icon in finder.Please help I am totally confused.



hiteshkumar-ubharanis-computer:/ root# cd /Applications/xampp/xamppfiles/var
<ter:/Applications/xampp/xamppfiles/var root# sudo chmod -R ug=rwX, o=rX mysql/
chmod: Invalid file mode: ug=rwX,
<amppfiles/var root# sudo chmod -R ug=rwX,o=rX mysql/
<mppfiles/var root# sudo /Applications/xampp/xamppfiles/mampp restart
Stopping XAMPP for MacOS X 0.6.1...
XAMPP: XAMPP-Apache is not running.
XAMPP: XAMPP-MySQL is not running.
XAMPP: XAMPP-ProFTPD is not running.
XAMPP stopped.
Starting XAMPP for MacOS X 0.6.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.
<mppfiles/var root# /Applications/xampp/xamppfiles/bin/mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/xampp/xamppfiles/var/mysql/mysql.sock' (2)[/img]
tantrik
 
Posts: 4
Joined: 31. March 2007 20:03

overwritten application folder

Postby tantrik » 27. May 2007 22:50

hi I tried the vanderaj, and xampp started working, but the problem is it overwrote the existing application foler, for non root users, so now if i login as anyone other than root, and try to click on applicaitons in finder, it only shows xampp nothing else, when I try to click on application it shows a question mark on that icon in doc, and is unable to open the application. please, can anyone help me with that, in restoring the application folder.
tantrik
 
Posts: 4
Joined: 31. March 2007 20:03

Next

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 12 guests