美文网首页
修改mysql密码

修改mysql密码

作者: 慧琴如翌 | 来源:发表于2018-01-13 10:32 被阅读7次

    1.登录mysql
    mysql -uroot -p
    2.修改密码需要use mysq的数据库

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | myflaskapp         |
    | mysql              |
    | performance_schema |
    | test               |
    +--------------------+
    5 rows in set (0.01 sec)
    
    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> update user set password=password('test123') where user='root';
    Query OK, 3 rows affected (0.06 sec)
    Rows matched: 3  Changed: 3  Warnings: 0
    

    再次登录时,输入命令:

    >mysql -uroot -p
    >#这里输入新的更改后的密码
    

    相关文章

      网友评论

          本文标题:修改mysql密码

          本文链接:https://www.haomeiwen.com/subject/pfqcoxtx.html