标签:update 修改密码 erro local rar log 退出 neu ble
今天mysql升级到8.0.13版本,遇到了很多问题,在此进行总结方便以后查看。
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
brew install mysql
安装完成后
通过brew操作mysql
# 获取service列表
brew services list
# 重启mysql服务
brew services restart mysql
# 停止mysql服务
brew services stop
我在这里遇到的最大的问题就是修改mysql的root账号的密码
mysql安装成功之后root是不需要密码的
1、查询mysql的root信息
select host, user, authentication_string, plugin from mysql.user;
2、把root账号的密码置为空
update user set authentication_string=‘‘ where mysql.user=‘root‘;
3、退出到外面页面执行升级mysql后的命令
mysql_upgrade -u root -p 直接回车就可以,不需要输入密码
如果不用这个命令就会报错:ERROR 1146 (42S02): Table ‘mysql.role_edges‘ doesn‘t exist
4、修改密码
ALTER USER ‘root‘@‘localhost‘
IDENTIFIED WITH mysql_native_password
BY ‘你的密码’;
注意:
(1)密码需要是八位,并且带有大写字母,小写字母,数字,特殊字符。
5、退出之后重新登陆即可。
参考url:https://my.oschina.net/niepanLs/blog/2876277
https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html
https://blog.csdn.net/xueyubingfeng1/article/details/81738643
标签:update 修改密码 erro local rar log 退出 neu ble
原文地址:https://www.cnblogs.com/lixiaochao/p/10288943.html