Linux 下修改 mysql 默认密码

  1. 首先登陆mysql
mysql -u root -p
  1. 初始化密码位置
vi /var/log/mysqld.log
2018-05-10T06:27:45.658106Z 1 [Note] A temporary password is generated for root@localhost: an_F13N:fXNf
  1. 设置新的root密码
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
Query OK, 0 rows affected, 1 warning (0.00 sec)
    原文作者:阿波罗程序猿
    原文地址: https://www.jianshu.com/p/71d8b3564d1d
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞