If you downloaded and installed from .dmg package already, and mightbe sometime it sucks because of some reason like me, i gem install mysql2.

1 Remove mysql from you Mac OS X

1.1 backup your database by mysqldump, of course if you want to.

1.2 stop the database. "sudo mysqladmin shutdown" or from the preference panel.

1.3 remove MySQL binary and configuration files

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*

1.4 If MySQL automatically at boot and the system preference panel,

sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*

1.5 mac OS keeps track of installed applications by tracking "receipts".

sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

Then look for receipts in a different location. Open up /Library/Receipts/InstallHistory.plist, find the entry for MySQL, delete the entry.

One more location: look in /private/var/db/receipts/ and search for mysql in the directory. There should be 2 files, delete them.

2 Install by Homebrew

brew install mysql

mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql.server start
 

Then if mysql start successfully,

mysql_secure_installation

step by step.

PS: You might get this error:

 “ERROR! The server quit without updating PID file”.

1

sudo chmod -R 755 /usr/local/var/mysql
$ rm -Rf /usr/local/var/mysql/Your-Machine-Name.local.err

2

ps aux | grep mysql

Then "kill -9 xxxx" to kill all the progress.

3

mv /etc/my.cnf /etc/my.cnf.old

4

mv /var/lib/mysql/ib_logfile* /root/

May be other reasons, hope this helps.

http://nali.org/remove-mysql-from-mac-os-x-snow-leopord/

http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial/

http://linuxadministrator.pro/blog/?p=225

Mysql On Mac OS: Remove & Install的更多相关文章

  1. Installing Apache, PHP, and MySQL on Mac OS X

    I have installed Apache, PHP, and MySQL on Mac OS X since Leopard. Each time doing so by hand. Each ...

  2. Install MySQL on Mac OS X——MAC安装MySQL

    很多关于如何安装MySQL的教程已经过时了,或者比必须的步骤复杂得多.这篇教程将展示如何安装MySQL,启动MySQL,以root用户进入MySQL,以及创建删除退出数据库. Step 1: 下载My ...

  3. mysql on Mac OS

    在新买的macbook pro15上安装了mysql,发现2个问题 一个是workbench基本无法正常退出,都要force quit 第二是我正常通过workbench连接后,查看系统log,会发现 ...

  4. mac os x install redis-3.2.9

    下载.解压.重命名并且编译安装Redis~ wget http://download.redis.io/releases/redis-3.2.9.tar.gz ~ tar xzf redis-3.2. ...

  5. 在Mac OS X中配置Apache + PHP + MySQL 很详细

    这是一篇超级详细的配置mac os下面php+mysql+apache的文章.非常详细我的大部分配置就是参考上面的内容的,比如,PHP不能连接数据库,就是改一下默认的php.ini中pdo_mysql ...

  6. 在Mac OS X下使用Apache、PHP、MySQL、Netbeans、Yii

    本文环境: Mac OS X:10.8.4 Apache:2.2.22 PHP:5.3.15 Netbeans:7.3.1 Yii:1.1.14 Mac OS X是内置了Apache服务器的,不过默认 ...

  7. 【转】在Mac OS X 10.8中配置Apache + PHP + MySQL

    CHENYILONG Blog 在Mac OS X 10.8中配置Apache + PHP + MySQL 在Mac OS X 10.8中配置Apache+PHP+MySQL的内容包括: 配置Apac ...

  8. PHP初步:在Mac OS X Yosemite下搭建Apache+PHP+Mysql

    Mac OS X是基于unix的操作系统,很多软件都集成在系统中.所以,对于配置PHP的开发环境相对于windows和Linux更简单. 1. 启动Apache服务器 打开终端(terminal),查 ...

  9. mac os 上安装mysqldb血泪史

    昨天下午在mac上安装mysql-python一直未遂今天查了很多资料终于成功了 最后还是在stackoverflow点击打开链接(好网站啊,一般有什么技术问题在这都能找到)上找到了答案,废话少数: ...

随机推荐

  1. jQuery使用scrollTop获取div标签的滚动条已滚动高度(jQuery版本1.6+时,用prop()方法代替attr()方法)

    $("#content").append('<div>' + data.msg + '</div>'+.'<br>');$('#content' ...

  2. 在Eclipse中查看Javadoc文档

    当我们需要查看JDK中类的API介绍时,通常采用的方式是直接查看离线文档或者某些网站提供的在线文档.如下图: 而本文档最终达到的效果是,不需要切换出eclipse,直接在eclipse中查看JDK的J ...

  3. 【jmeter】 jmeter 测试HTTP接口

    到apache官网下载jmeter:http://jmeter.apache.org/download_jmeter.cgi 1.运行 bin/jmeter.bat ,添加线程组 2.添加HTTP请求 ...

  4. Dubbo -- 系统学习 笔记 -- 示例 -- 只订阅

    Dubbo -- 系统学习 笔记 -- 目录 示例 想完整的运行起来,请参见:快速启动,这里只列出各种场景的配置方式 只订阅 问题 为方便开发测试,经常会在线下共用一个所有服务可用的注册中心,这时,如 ...

  5. vs2012修复问题

    多装了一个.net framework4.5.1结果vs不能拥,借用了下面这个工具将vs2012从注册表中删除了 就能重装了 http://www.auslogics.com/en/software/ ...

  6. 【Python】Docx解析

    1.cd D:\ProgramData\Anaconda3 2.pip install python-docx 3.python代码处理 # -*- coding: utf-8 -*- import ...

  7. 【Cesium】flyTo

    // 1. Fly to a position with a top-down view viewer.camera.flyTo({ destination : Cesium.Cartesian3.f ...

  8. 【Android】录音-amr音频录制

    http://www.cnblogs.com/fengzhblog/archive/2013/08/01/3231500.html http://blog.csdn.net/fan7983377/ar ...

  9. windows应急响应入侵排查思路

    0x00 前言 ​ 当企业发生黑客入侵.系统崩溃或其它影响业务正常运行的安全事件时,急需第一时间进行处理,使企业的网络信息系统在最短时间内恢复正常工作,进一步查找入侵来源,还原入侵事故过程,同时给出解 ...

  10. java.lang.IllegalArgumentException: No converter found for return value of type

    原文地址: http://blog.csdn.net/linhaiguo/article/details/51554766 问题原因: 请求返回的数据无法转换,需要添加如下配置 解决方法: 1.在po ...