12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-29 09:51:43
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
安装完mysql5.7后忘记了密码,需要重置root密码;第一步:修改配置文件免密码登录mysqlvim /etc/my.cnf##在my.cnf的[mysqld]字段加入skip-grant-tables## 重启mysql服务service m
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
安装完mysql5.7后忘记了密码,需要重置root密码;
第一步:修改配置文件免密码登录mysql
vim /etc/my.cnf##在my.cnf的[mysqld]字段加入skip-grant-tables## 重启mysql服务service mysqld restart
第二步:免密码登录mysql
mysql -u root ##password直接回车
第三步: 给root重置密码为空
mysql>use mysql;## mysql 5.7.9以后废弃了password字段,字段名修改为authentication_stringmysql>update user set authentication_string='' where user='root';## 刷新数据库mysql>flush privileges;
第四步: root重置密码
退出mysql,删除/etc/my.cnf文件最后的 skip-grant-tables 重启mysql服务,使用root用户进行登录,因为上面设置了authentication_string为空,所以可以免密码登录。
alter user 'root'@'localhost' identified by '#新密码#';
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19