(homebrew.mxcl.mysql[2274]): Service could not initialize: Unable to set current working directory. error = 2: No such file or directory If I run console on my mac and go to the system.log I see that system,log is getting flooded with this error

Oct 31 15:57:59 abhisheks-mbp com.apple.xpc.launchd[1] (homebrew.mxcl.mysql[2185]): Service could not initialize: Unable to set current working directory. error = 2: No such file or directory, path = /usr/local/var/mysql: 17A405: xpcproxy + 11040 [1403][43FABD4F-8081-3087-91BC-95B588688D55]: 0x2
Oct 31 15:57:59 abhisheks-mbp com.apple.xpc.launchd[1] (homebrew.mxcl.mysql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Oct 31 15:58:03 abhisheks-mbp com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.


I had installed mysql using homebrew many months ago. but I had removed it I don't know why its still trying to run it.

I tried to remove mysql 

~ &gt; brew uninstall mysql
Error: No such keg: /usr/local/Cellar/mysql


But still i see messages pouring in.
You probably enabled the MySQL launch agent with brew services start mysql in the past and forgot to disable the brew service (before uninstalling mysql) which would remove the plist.

So unload and remove the agent from the launchd database manually with:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl remove ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


Then remove the file:

rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


If you did a custom install of the plist, the file homebrew.mxcl.mysql.plist may reside in /Library/LaunchAgents. Use the same commands then but adjust the paths above and prepend sudo.