1

Thank you to samt for solving the first problem with chown!

I run the command

$sudo /opt/local/bin/mysqld_safe5 &                                                                                                                      ~ 
[1] 1096
$Password:                                                                                                                                              ~ 1

[1]  + suspended (tty output)  sudo /opt/local/bin/mysqld_safe5

The process is now at the jobs for some reason, so I get it back

$%1                                                                                                                                                     ~ 1
    [1]  + continued  sudo /opt/local/bin/mysqld_safe5
    Password:
    Starting mysqld daemon with databases from /opt/local/var/db/mysql5
    STOPPING server from pid file /opt/local/var/db/mysql5/eMY-IP-ADDRESS.elisa-laajakaista.fi.pid
    090705 12:37:45  mysqld ended

I do not know why my MySQL is shutting down.

Do you know why my MySQL is shutting down?

1

6 Answers 6

1

Here's some basic stuff, so apologies if you've already tried them.

  • Try

    $ sudo su

    # /opt/local/bin/mysqld_safe5

    If this works then there may be a problem with the way PATH is set when using sudo

  • Is 'chown' in your filesystem (you identify the manual pages and package are on, but don't explicity identify that it is on the system)

    • I don't know how it's done on the Mac OS/X but you could try 'locate' and 'which', or 'find'

    locate chown

    will search a database of the filesystem to see if 'chown' has been 'indexed'

    which chown

    will search your PATH to see whether the filename 'chown' is in your path

    find / -type f -name chown

    is the hardway and traverses your hard disk looking for a filename chown

  • Check the PATH setting in /opt/local/bin/mysqld_safe5

    • some startup scripts set their own PATHs, and if the 'chown' is not explicitly pathed, then the system will traverse the scripts PATH not your's or SUDO's
  • Check your sudo settings, the environment settings there (i.e. including PATH) may be more explicit.

7
  • @samt: What do you mean by "sudo settings"? --- Which variables do you mean at environment settings? Jul 4, 2009 at 21:52
  • which chown suggests me that there is no chown in my Mac. This is strange, since I have its manual in my Mac. Jul 4, 2009 at 21:54
  • 1
    chown should be available at /usr/sbin/chown unless something has modified your installation of OS X.
    – Chealion
    Jul 5, 2009 at 5:50
  • 1
    @Masi: Check that sudo is actually on your machine (as per Chealion) and check whether /usr/sbin is in your path. sudo let's the system allow unprivileged users to execute programs at an elevated level (e.g. as root privilege) and as a safety precaution 'sudo' can be configured to provide specific environments (e.g. remove certain Environment settings, change others, like removing/changing the PATH environment.) /etc/sudoers normally tells you what your user account can do, www.sudo.ws for online manual pages/samples.
    – samt
    Jul 5, 2009 at 8:35
  • 1
    I did not have /usr/sbin/ in my PATH. Thank you for pointing that out! Jul 5, 2009 at 9:09
3

chown: command not found

That suggests to me that chown is not in the path for the user account running the startup script. Try editing that script to use the full path.

2

If you installed mysql using MacPort I would really suggest you to use the package installer from MySQL website

2
  • I port uninstall MacPort's MySQL and I installed the MySQL by the package installer. --- I get the same error message. It seems that I have now the newest MySQL. Jul 4, 2009 at 17:31
  • Did you read the read me file ? "If you have installed the Startup Item, use this command: shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start" or "If you don't use the Startup Item, enter the following command sequence: shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safe"
    – radius
    Jul 5, 2009 at 12:43
2

Under OS X daemons are controlled by launchd, try this (you may have to adjust it slightly for your version of mysql installed)

sudo -u mysql mysql_install_db5
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist5

If these files are not available then you may not have the +server variant of the mysql5 port.

sudo port install mysql5-server
2
  • I get the following warnings in running the commands: dpaste.com/63345 Jul 5, 2009 at 9:09
  • @Masi: Those two warning simply state that the launchd plist was never installed (more than likely you installed MySQL through MacPorts or Fink instead of the official package as seen in the answer)
    – Chealion
    Jul 6, 2009 at 4:16
1

try lunching

sudo /opt/local/bin//mysqld --verbose

skip & - do not put it in background, just open separate console for it. maybe verbose output will provide you with helpful error msgs.

6
0

You can manually set the owner of /opt/local/var/db/mysql5, it must be _mysql (at least in my installation)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .