通过dmg安装mysql@5.7 并解决mysql 未能载入偏好

2019-11-09  本文已影响0人  zackxizi

注意出现下面的一定要截图保存

image.png

有的同学不要急,发现自己那没有MySQL入口,请继续往下看,有解决方案

image.png
image.png
vim ~/.bash_profile

进入vim 书写
首先输入 i 代表咱们准备书写了
第二步 书写一下内容

export PATH="$PATH:/usr/local/mysql/bin"

第三步 按 esc 键 再输入:x 回车
第四步

source ~/.bash_profile
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySQL*
sudo rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

重新安装,应该就会有了

*重置密码
输入刚刚安装让大家保存的密码

mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.28

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

修改密码

set PASSWORD =PASSWORD('root');

密码忘记的同学,可以看下面的文章

MySQL忘记密码处理m

上一篇 下一篇

猜你喜欢

热点阅读