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. $(this).bind("change",itemno_change);

    如果是onchange 会出错,超过3个可能就无效.

  2. [原创]解决jQuery.live在mobile safari(iphone / ipad / ipod)绑定失败的问题

    解决方案: 给要使用live绑定事件的元素,添加“cursor:pointer”样式即可! 如: a,input,td{cursor:pointer;} 原文链接:http://bugs.jquery ...

  3. asp.net GridView实现多表头类 多行表头实现方法

    以上列表中运用的都是基本的东东: 1.多表头: 2.按值改变行颜色: 3.分页码 代码: AndyGridViewTHeaderHepler.cs //------------------------ ...

  4. PowerDesigner使用技巧(转载)

    1.如何打开PowerDesigner 快捷工具栏 paletteTools(工具栏)--> customsize toolbars(自定义工具栏)-->勾选 palette(调色板) 2 ...

  5. Unity3D热更新LuaFramework入门实战

    http://blog.sina.com.cn/s/blog_6788cd880102w8qy.html http://www.manew.com/thread-91845-1-1.html http ...

  6. bashrc profile的区别

    bashrc与profile的区别 bashrc和profile的差异在于:1. bashrc是在系统启动后就会自动运行.2. profile是在用户登录后才会运行.3. 进行设置后,可运用sourc ...

  7. linux环境中,read命令的使用?

    需求描述: 今天有一个需求主要是从一个文件中夺取内容,文件中每行呢又是有多个字段,中间通过空格来分隔的.那么这样的话,就是用到了read命令 在这里记录下read的使用方法. 命令说明:read命令就 ...

  8. mysql中,什么是视图,视图的作用是什么?

    需求描述: 在看mysql的视图,对于视图的定义,进行基本的了解,在此记录下. 概念解释: 视图:存储的查询语句,当调用的时候,产生结果集,视图充当的是虚拟表的角色. 测试过程: 说明: 如果要对一张 ...

  9. 使用monkey技术修改python requests模块

    例如请求前和请求后各来一条日志,这样就不需要在自己的每个代码都去加日志了. 其实也可以直接记录'urllib3.connectionpool'  logger name的日志. 修改了requests ...

  10. PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档

    PowerDesigner导出word,PowerDesigner把表导出到word,PDM导出word文档 >>>>>>>>>>>& ...