• 【Vegas原创】新版MYSQL(8以上)修改初始root密码的方法


    很遗憾的告诉你,你网上查到的各种改my.enf ,各种update,在新版MYSQL中,统统失效。

    解决方法,如下:

    1.

    [root@yisu-5f735cb14d716 ~]# service mysqld start
    Redirecting to /bin/systemctl start mysqld.service
    

      

    2.

    [root@yisu-5f735cb14d716 ~]# mysql -v
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 8
    Server version: 8.0.22
    
    Copyright (c) 2000, 2020, 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.
    
    Reading history-file /root/.mysql_history
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    

      

    3.在尝试切换database的时候,mysql已经很友好的提示,使用alter user改密码:

    mysql> use mysql;
    ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
    

      

    4. 那我们就改吧。

    mysql> alter user 'root'@'localhost' identified by 'Li234*&……F&%';
    --------------
    alter user 'root'@'localhost' identified b 'Li234*&……F&%'
    --------------
    
    Query OK, 0 rows affected (0.01 sec)
    

      

    5. flush权限,结束

    mysql> flush privileges;
    --------------
    flush privileges
    --------------
    
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> quit
    Writing history-file /root/.mysql_history
    Bye
    

      

    6.登录测试。

  • 相关阅读:
    hdu--1231--并查集<连分量的个数>
    hdu--1272--并查集||图的特点
    hdu--1856--并查集的离散化处理
    hdu--1285 && 4857 --正向 || 逆向拓扑排序 && 优先队列
    hdu--1671--字典树<出现mle怎么解决>
    CF260--C--dp<最大不连续子序列和>
    Hibernate之级联关系配置的作用
    调用JS的方法
    Hibernate映射关系之多对多
    Hibernate映射关系之一对多
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/13847708.html
Copyright © 2020-2023  润新知