zoukankan      html  css  js  c++  java
  • linux环境下mysql修改root密码

    知道原来的myql数据库的root密码;

    ①: 在终端命令行输入 mysqladmin -u root -p password "新密码" 回车 ,Enter password: 【输入原来的旧密码】--方法1
    ②: 登录mysql系统修改, mysql -uroot -p 回车 Enter password: 【输入原来的密码】--方法2

    mysql>use mysql;

    mysql> update user set password=password("新密码") where user='root';        【密码注意大小写】

    mysql> flush privileges;

    mysql> exit;      

    不知道原来的myql的root的密码;
    首先,你必须要有操作系统的root权限了。要是连系统的root权限都没有的话,先考虑root系统再走下面的步骤。 类似于安全模式登录系统。

    需要先停止mysql服务,这里分两种情况,一种可以用service mysqld stop,

    另外一种是/etc/init.d/mysqld stop

    当提示mysql已停止后进行下一步操作   Shutting down MySQL. SUCCESS!

    在终端命令行输入

    mysqld_safe --skip-grant-tables &         【登录mysql系统】

    输入mysql登录mysql系统

    mysql> use mysql;

    mysql> UPDATE user SET password=password("新密码") WHERE user='root';      【密码注意大小写】

    mysql> flush privileges;

    mysql> exit;

    重新启动mysql服务
    ————————————————

    原文链接:https://blog.csdn.net/qq_42822007/article/details/90550614

  • 相关阅读:
    Ping
    boost::python开发环境搭建
    mingw和libcurl
    ssh远程执行命令使用明文密码
    netty源码阅读之UnpooledByteBufAllocator
    Direct ByteBuffer学习
    clions的使用
    netty中的PlatformDependent
    STL之priority_queue(优先队列)
    c++线程调用python
  • 原文地址:https://www.cnblogs.com/ivy-zheng/p/12214727.html
Copyright © 2011-2022 走看看