任何时候你都可以开始做自己想做的事

搜索|
llinux下重置MYSQL数据库root密码
发布时间:2023-09-15 09:04:03

5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string

vi /etc/my.cnf  # mysql数据库重要核心配置文件

1.vim /etc/my.cnf 进行编辑,加入skip-grant-tables

2、systemctl restart mysqld 重启Mysql

3.mysql 登录 无需密码

------------------------------------------------

update mysql.user set authentication_string=password('NB/nb123321') where user='root';#5.7的方法


flush privileges;

--------------------------------------

Linux查看mysql是否启动的命令

service mysqld status


mysql数据库停止,重启,启动的命令:

service mysqld stop

service mysqld restart

service mysqld start


上一篇:linux安装MYSQL
下一篇: centos7防火墙命令