疯狂编程网

  • 首页
  • 后端
    • GOLANG
    • PHP
  • 前端
  • 客户端
  • 服务器
  • AIGC
  • 开发工具
  • 代码人生
  • 关于本站
    • 联系我们
    • 免责声明
  1. 首页
  2. 服务器
  3. MYSQL
  4. 正文

mysql8.0安装完首次给root账号设置密码

2023年4月13日 658点热度 0人点赞 0条评论

系统环境:centos7/8 或者 opencloudos8,首次安装完mysql8.0后,需要给root设置密码,步骤如下

启动 systemctl start mysqld
重启 systemctl restart mysqld

#首次进入mysql
mysql -uroot -p

# 将authentication_string置空
update user set authentication_string='' where user='root';

# 将plugin改为以前版本的密码认证方式
update user set pulgin='mysql_native_password' where user='root';

#刷新
flush privileges;

#修改密码
alter user 'root'@'localhost' identified by '123126';

#重启
systemctl restart mysqld

标签: centos mysql
最后更新:2023年4月13日

大明

靠写代码养家的开发者。

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 疯狂编程网. ALL RIGHTS RESERVED.

京ICP备2022013580号-1