mysql5.8
查看默认密码
cat /var/log/mysqld.log|grep 'temporary password'
查不到,先关闭数据库
1.通过在命令后面加上--user=root 进行强制使用root账号启动。这样是最快的。
cd /etc/init.d
mysqld --user=root
再查看 cat /var/log/mysqld.log|grep 'temporary password'
修改密码,设置新用户授权远程登录
alter user 'root'@'localhost' identified by '1qWwww@2020';
create user 'jamin'@'%' identified by '1qWwww@2020';
grant all privileges on *.* to 'jamin'@'%' with grant option;
ALTER USER 'jamin'@'%' IDENTIFIED BY '1qWwww@2020' PASSWORD EXPIRE NEVER;
ALTER USER 'jamin'@'%' IDENTIFIED WITH mysql_native_password BY '1qWwww@2020';
最后
以上就是能干大象最近收集整理的关于mysql5.8 设置密码的全部内容,更多相关mysql5.8内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复