博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mysql On Mac OS: Remove & Install
阅读量:6801 次
发布时间:2019-06-26

本文共 1728 字,大约阅读时间需要 5 分钟。

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/mysqlsudo rm -rf /usr/local/mysql*

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

sudo rm -rf /Library/StartupItems/MySQLCOMsudo 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/LaunchAgentslaunchctl 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”.

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.

 

转载于:https://www.cnblogs.com/iosdev/p/3385991.html

你可能感兴趣的文章
DS博客作业01—日期抽象数据类型设计与实现
查看>>
【BFS】HDU1429 - 胜利大逃亡(续)
查看>>
linux下mysql忘记root密码的解决方案
查看>>
世界历史教科书-九年级上册.pdf
查看>>
LDAP Authentication for openNebula3.2
查看>>
C++ STL 学习笔记__(6)优先级队列priority_queue基本操作
查看>>
Max user processes limits
查看>>
APP 上线-打包上传环境配置(接上篇)
查看>>
图片垂直居中,兼容ie6
查看>>
iOS--资料--开源项目及库
查看>>
MBR(Master Boot Record)主引导记录分析
查看>>
词汇小助手V1.1——引入自动翻译和在线词典功能
查看>>
委托-异步调用-泛型委托-匿名方法-Lambda表达式-事件
查看>>
国债期货下跌意味着什么
查看>>
抽象类的应用——汽车租赁系统
查看>>
算法67-----环绕字符串中唯一的子字符串【动态规划】
查看>>
问题 G: 心急的C小加
查看>>
gdb查死循环方法
查看>>
购物单
查看>>
HDU 2196 Computer 树形DP
查看>>