月度归档:2015年11月

mac上如何删除mysql

电脑用了4年了,很早前装过mysql,系统偏好设置还有快捷菜单,早先还能用来启动mysql,应该是很多年没用过了,最近公司项目我打算用php+mysql来做,然后才发现本机的mysql已无法启动,一直ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)这个错误,照着网上各种教程chmod或者ln做链接都没解决。决定放弃,直接使用XMAPP算了。

不过xmapp确实很方便,对于做php开发而言,集成了apache,php,mysql等服务。

回归正题,如何从mac上删除mysql,参考链接

  • Open a terminal window
  • Use mysqldump to backup your databases to text files!
  • Stop the database server
  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*
  • sudo rm -rf /private/var/db/receipts/mysql
  • sudo rm -rf /var/db/receipts/com.mysql.*