• ADADADADAD

    mysql5.7重置密码的sql语句怎么写[ mysql数据库 ]

    mysql数据库 时间:2024-11-29 10:09:12

    作者:文/会员上传

    简介:

    mysql5.7重置密码的方法:首先执行【update user set authentication_string = password('123456') where user = 'root';】语句;然后重启mysql服务即可。具体

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    mysql5.7重置密码的方法:首先执行【update user set authentication_string = password('123456') where user = 'root';】语句;然后重启mysql服务即可。

    具体方法:

    关闭MySQL5.7的权限系统

    找到MySQL5.7的配置文件my.cnf

    在文件末尾编辑增加代码skip-grant-tables

    重启mysqld服务,登陆MySQL

    $systemctl restart mysqld

    此时再登录mysql时,不需要密码就登录进去了。

    修改root密码

    $use mysql;$select host,user,authentication_string from user;#修改root密码$update user set authentication_string = password('123456') where user = 'root';

    开启权限系统,重启MySQL,新密码登录

    $vim /etc/my.cnf#开启权限系统#skip-grant-tables#重启mysql$systemctl restart mysqld#新root密码登陆$mysql -uroot -p
    mysql5.7重置密码的sql语句怎么写.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysql5.7重置密