Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Turning off Stock MySQL

For some time now we have been running our web sites off of the official MySQL release (installed in /usr/local via the package release) as well as the entropy release of php5. Recently while diagnosing some other issues I noticed that the stock MySQL was trying to run-- the log was filling with messages from launchd saying that MySQL was trying to start up but couldn't because another MySQL was running.

MySQL was shown as off in Server Admin. I quit the official release to update it from a new package. The stock MySQL started up and now I can't get it to stop. Server admin can't stop it from either the GUI or the command line. It starts right up if I restart the computer even though I can't find any .plist that would indicate it is telling MySQL to start up. I really just want to kill the stock MySQL and keep it killed. Any ideas of where I should be looking.

By the way, I can't enter a root password from server admin because MySQL won't shut down.

TIA

iMac, Mac OS X (10.5.5)

Posted on Oct 30, 2008 9:51 AM

Reply
8 replies

Oct 30, 2008 11:24 AM in response to Camelot

Thanks. I had looked there but didn't see anything Here is the content of org.mysql.mysqld.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.mysql.mysqld</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/libexec/mysqld</string>
<string>--socket=/var/mysql/mysql.sock</string>
<string>--user=mysql</string>
<string>--port=3306</string>
<string>--datadir=/var/mysql</string>
<string>--pid-file=/var/mysql/h-72-245-196-242.snfccasy.covad.net.pid</string>
</array>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>

I know that we are getting a bad DNS reverse that we are trying to resolve, but that was the only thing I saw in the file that seemed problematic. I do have a disabled key and OnDemand is off. Do you see anything else?

By the way, when I run serveradmin with full status I get:

*mysql:setStateVersion = 1*
*mysql:defaultFilesInstalled = yes*
*mysql:state = "RUNNING"*
*mysql:startTime = ""*
*mysql:logPaths:mysqlAdminLog = "/Library/Logs/MySQL.log"*
*mysql:logPaths:mysqlServiceLog = "/var/mysql/ferrari-moe.com.err"*
*mysql:readWriteSettingsVersion = 1*
*mysql:databaseLocation = "/var/mysql"*
*mysql:networkConnectAllowed = no*

When I run +sudo serveradmin stop mysql+ I get +mysql:error = "CANNOT STATERR"+

I was hoping to just kill it with mysqladmin, but I get

*mysqladmin: connect to server at 'localhost' failed*
*error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'*
*Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!*

I also don't have a mysql daemon showing up in Activity monitor

In MySQL.log I show
*2008-10-30 11:03:28 US/Pacific Stopping MySQL Service*
*2008-10-30 11:03:37 US/Pacific
Stopping MySQL daemon...*
*2008-10-30 11:08:44 US/Pacific [E] MySQL daemon shutdown timed-out.*

When I run serveradmin shutdown.

Is it possible that serveradmin is just getting bad information somehow and MySQL really isn't running?

Thanks in advance

Oct 30, 2008 12:18 PM in response to Austin Sloat

IIRC you can't rely on serveradmin if you've installed your own copy of apps. There's all kind of crossovers where serveradmin expects to find things in certain places and they're not there thanks to your custom install.

If you're running your own installation then you need to run your own (or vendor-provided) scripts to manage the server and pretty much ignore what serveradmin is telling you.

Oct 30, 2008 12:26 PM in response to Camelot

I think that is generally true, but there should be no crossover between Apple's MySQL install and the "official" MySQL install, at least according to the documentation from both sources. Serveradmin was reporting a running mysql although according to activity manager and top there were no mysql daemons running-- either stock or official. I just decided to force the official mysql to start up and it appears that it has. Hopefully launchd won't try to start up the stock release. I move the launchdaemon plist file so we will see.

Oct 30, 2008 1:21 PM in response to Austin Sloat

I wouldn't encourage running two instances of a package on one box in parallel; any directions to the contrary, two separate versions in parallel is just asking for trouble. Certainly no overlap on the files and directories and such; it's having both versions running that I'd expect to see problems.

Pick one, and disable the other.

I do know of a few platforms and products that can run multiple versions in parallel (and outside of a virtual machine), but those platforms and products are rare.

Oct 31, 2008 1:34 PM in response to Austin Sloat

I was seeing a lot of MySQL errors in my system log which surprised me since I didn't have MySQL enabled in my Server Admin.

I went into System Preferences and found a MySQL preference pane, it said that MySQL was running. Is this preference pane supposed to be there? I don't remember installing MySQL in the past, but maybe I did?

Furthermore I can't turn off this MySQL, I click the Stop button but it still says it is running.

If this isn't supposed to be there how do I uninstall it?

Turning off Stock MySQL

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.