Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > MySQL is dead?

MySQL is dead?
Thread Tools
Jaey
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 7, 2004, 06:12 PM
 
Um, I can't start the MySQL server... I followed these instructions, but when I try to start the server I get

"Starting mysqld daemon with databases from /usr/local/mysql/data
040407 18:00:28 mysqld ended


[1]+ Done sudo ./bin/mysqld_safe"

And the tutorial said to look at my .err file in /usr/local/mysql/data.. So I did.
It says

"040407 18:00:28 mysqld started
040407 18:00:28 Can't start server : Bind on unix socket: Permission denied
040407 18:00:28 Do you already have another mysqld server running on socket: /t
mp/mysql.sock ?
040407 18:00:28 Aborting

040407 18:00:28 /usr/local/mysql/bin/mysqld: Shutdown Complete

040407 18:00:28 mysqld ended"


I don't have root enabled on my computer, and I was thinking that might be the problem...
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Apr 7, 2004, 09:18 PM
 
Originally posted by Jaey:
I don't have root enabled on my computer, and I was thinking that might be the problem...
By default MySQL runs on port 3306 which is not a privileged port.

I don't have root enabled and am running MySQL on several machines with no issues.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 7, 2004, 09:38 PM
 
So what can I do...?
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 8, 2004, 12:05 AM
 
Originally posted by Jaey:
So what can I do...?
From the terminal type:-.

ps -ax | grep mysql

You should see (hopefully) only one entry that reads something like:-

6585 std U+ 0:00.01 grep mysql

If, however, you see more than that line, take note of the PID (process ID) and then proceed to kill them, one by one:-

sudo kill [insert id here]

It's more than likely that MySQL hasn't properly died, and it's still got a lock. This will really get rid of it for sure!

Now restart your mysql server:-

cd /usr/local/mysql (or whatever your install directory is)
sudo ./bin/mysqld_safe -umysql &

...and away you go...
Computer thez nohhh...
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 8, 2004, 01:10 AM
 
I get

2129 std R+ 0:00.00 grep mysql

Then when I restarted the server, I got

Starting mysqld daemon with databases from /usr/local/mysql/data
040408 01:05:00 mysqld ended

...
     
larkost
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Apr 8, 2004, 10:42 AM
 
MySQL has to be started using root. You do not have to have the root account enabled, you simply have to prefix the command with sudo. It will then ask you for your administrator password.

After this there are still a whole number of possible issues you could run into... you might want to read the instructions with a better eye for detail... *hint* *hint*
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 8, 2004, 04:26 PM
 
I've been using sudo...

Originally posted by larkost:
*hint* *hint*
Meaning the "Database Re-Initialization" part? That doesn't help either.
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 8, 2004, 08:43 PM
 
Originally posted by Jaey:
I've been using sudo...


Meaning the "Database Re-Initialization" part? That doesn't help either.
No worries, next thing to check is the error log - it will probably be in /usr/local/mysql/data called 'localhost.err' or something similar (as long as it has the .err) - you'll need to be 'su' or do a 'sudo' to get into that directory.

Post the last 10-20 lines of that log and we'll see what the problem is

Also, before you go too far, try removing the '.pid' file from the /usr/local/mysql/data directory and try restarting MySQL - sometimes that can stop MySQL from starting if it wasn't shut down correctly.

Cheers

(BTW - the 'hint' from larkost was to RTFM
Computer thez nohhh...
     
madmacgames
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Apr 8, 2004, 10:14 PM
 
failing to get it running, there is a package installer for OS X here:
http://www.serverlogistics.com/mysql.php

Plus it adds a pref panel to your System Preferences, so you can initialize, start, stop, and change root password easily.
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 8, 2004, 11:25 PM
 
127.0.0.1.err says:

"040408 16:20:27 mysqld started
040408 16:20:27 Can't start server : Bind on unix socket: Permission denied
040408 16:20:27 Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
040408 16:20:27 Aborting

040408 16:20:27 /usr/local/mysql/bin/mysqld: Shutdown Complete

040408 16:20:27 mysqld ended"

I don't see any .pid's in /usr/local/mysql/data...

madmacgames: I'll try that... see what happens
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 8, 2004, 11:39 PM
 
Um, I tried madmacgames' thing, and it didn't do anything... maybe I should completely wipe MySQL off of my hard drive and start from scratch?
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 9, 2004, 05:51 AM
 
Originally posted by Jaey:
Um, I tried madmacgames' thing, and it didn't do anything... maybe I should completely wipe MySQL off of my hard drive and start from scratch?
Now where's the fun in that?

try:-

sudo rm /tmp/mysql.sock

and then restarting mysql
Computer thez nohhh...
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 9, 2004, 04:02 PM
 
rm: /tmp/mysql.sock: No such file or directory
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Apr 9, 2004, 05:32 PM
 
Originally posted by Jaey:
rm: /tmp/mysql.sock: No such file or directory
Methinks therein lies the problem. Unless you've changed where the mysql socket is located, anyway.

What happened to me a few months ago, is that I installed a more recent version of MySQL on top of an already running version (forgot to stop it - eejit, I know). I had this exact same problem, and so had to uninstall mysql and then re-install. Less fun, I know - but did the trick.

It may also be something to do with cron scripts cleaning out your tmp folder and therefore your mysql socket, but I'm not sure (and far to many pints is making me less sure....)
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 10, 2004, 11:50 PM
 
Originally posted by Black Book:
I had this exact same problem, and so had to uninstall mysql and then re-install. Less fun, I know - but did the trick.
Um yeah, that did nothing
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 11, 2004, 07:03 PM
 
And nobody has any ideas?
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 11, 2004, 09:25 PM
 
Originally posted by Jaey:
And nobody has any ideas?
Have you manually rebooted your machine before trying any of these commands?
Computer thez nohhh...
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 12, 2004, 06:42 PM
 
Originally posted by Simon Mundy:
Have you manually rebooted your machine before trying any of these commands?
Yes.
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 12, 2004, 07:58 PM
 
...and you've definitely started MySQL as root? (i.e. sudo ./bin/mysqld_safe -umysql & )
Computer thez nohhh...
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 12, 2004, 09:53 PM
 
Originally posted by Simon Mundy:
...and you've definitely started MySQL as root? (i.e. sudo ./bin/mysqld_safe -umysql & )
Starting mysqld daemon with databases from /usr/local/mysql/data
040412 21:48:48 mysqld ended


[1]+ Done sudo ./bin/mysqld_safe -umysql
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 13, 2004, 01:36 AM
 
Originally posted by Jaey:
...ok.. NEXT thing to try is fixing your permissions:-

sudo chown -R mysql:mysql /usr/local/mysql/*

and then try restarting it - in a lot of cases if there are files that mysql can't get exclusive access to, it will fall over.
Computer thez nohhh...
     
Jaey  (op)
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Apr 13, 2004, 01:44 AM
 
Um yeah.. didn't work...
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Apr 13, 2004, 01:10 PM
 
Is it still not working?

If not, have a look here for a few pointers.

Anyhoo, if you still can't get it working, I think we're going to need some more detailed info.
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:43 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,