mac中修改端口和linux中不同,參考: https://stackoverflow.com/questions/5320424/change-port-for-mysql-on-mac
先stop mysql server, 然後按照下面的建議修改:
I installed docker and was having problems with my company wanting to use port 3306 (which is what I was using privately).
Similar problem to you. So this is what I did to fix it.
sudo vi /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
Then you get a long list of script tags and
Insert
<string>--port=3307</string>
into the array. Make sure you put it under the other strings and within the array.