I am unable to start mysqld via mysql 5.6's mysqld_safe after upgrade to MacOS 10.15 Catalina.
<?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>RunAtLoad</key> <true/>
<key>KeepAlive</key> <true/>
<key>SessionCreate</key> <true/>
<key>LaunchOnlyOnce</key> <false/>
<key>ExitTimeOut</key> <integer>600</integer>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/Users/owenbrunette/bin/mysqld_safe</string>
</array>
</dict>
</plist>
The working configuration prior to the 10.15 Catalina upgrade also had the user argument, but I have removed that above, and in further testing, for simplicity as the value of "mysql" is the default user within mysqld_safe.
Working configuration for 10.14 was:
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--user=mysql</string>
</array>
Both configurations do not work. I have tried initiating as a /bin/sh from the plist. The mysqld_safe is and mysqld are 5.6 as distributed by Apple (mysql-5.6.19-osx10.7-x86_64) and have been on the machine and runnning since OSX 10.7.
I am able to start the server from a terminal as:
export PATH=/usr/bin:/bin:/usr/sbin
sudo /usr/local/mysql/bin/mysqld_safe
which starts a process in the terminal and does not exit (Not to exit is the expected behavior). The process can then be shutdown from another terminal with:
mysqladmin --user=root --password=[MyAdminPassword] shutdown
In the resulting mysqld log I find:
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
This error indicates that the mysqld was started as the user root rather than as the user mysql. This is contrary to the intentions of mysql_safe, and I think is an important clue. Something may be behaving unexpectedly in msql_safe.
In the system log I find:
... com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.system): Session adoption is only allowed in user domains.
This may be fair comment, the mysql_safe script does not exit and remains running until the database server shuts down. This was the same under 10.14 but maybe 10.15 takes a differnt view.
In the Catalina release notes we are told: "Launch daemons and launch agents introduce new user privacy protections" and "launchd property list might not work as expected and prevent the service from running".