Starting and stopping the MySQL server via Preferences Pane/launchd and on the other hand via
sudo /usr/local/mysql/support-files/mysql.server start/stop are not really compatible.
After choosing "Launchd Support" in the MySQL installer the launch daemon com.oracle.oss.mysql.mysqld will be created and the MySQL preferences pane uses the launchd mechanism to start and stop mysql. If you enable "Automatically Start MySQL Server on startup", mysqld is enabled automatically after starting your Mac.
The pid file's name created by the launch daemon is not compatible with the one created and expected by the mysql-server script.
The launch daemon's pid file name created while running is mysql.local.pid, the script expects a name based on your Mac's hostname, .local or computer name though.
So either use the MySQL pref pane/launchctl or the script to start and stop mysqld.
To some extent you can make both methods compatible by modifying the file com.oracle.oss.mysql.mysqld though:
After stopping mysql replace the array
with $name: either HostName (e.g. host.example.com), LocalHostName (e.g. host.local) or ComputerName (e.g. host). Probably the best is to use a hostname. You may get a hostname with hostname with
scutil --get HostName or set it with
sudo scutil --set HostName your_hostname.
You can also get the actually used mysql-server script pid's name - after stopping the launch daemon and starting mysqld with
mysql-server start- by checking mysql's data directory with
sudo ls /usr/local/mysql/data. Use the name found there to adjust the plist's pid name.
You may have to convert the launch daemon file to xml to edit it. The app TextWrangler opens it as xml file immediately.
Reload the plist with launchctl afterwards.
Now should be able to start and stop with the MySQL pref pane and the mysql.server script.
If you have enabled "Automatically Start MySQL Server on Startup", you can't stop the server – even after modifying the plist – with the script because launchd overrides any stop command after a few seconds and launches mysqld again.