mysql 数据库忘记了密码处理

在安装完了忘记了登录数据库的密码,能够作如下的处理:mysql

一、修改root密码sql

sudo more /etc/mysql/debian.cnf数据库

用文件里的用户名密码登录Mysqlide

use mysql.net

update user set plugin='mysql_native_password' where user='root';get

update user set authentication_string=password('123') where user='root';string

flush privillege;it

二、配置远程访问数据库io

注释掉在/etc/MySQL/mysql.conf.d/mysqld.cnf里面的bind-address = 127.0.0.1配置

链接mysql数据库,修改user表

Grantall on *.* to 'root'@'%' identifiedby 'root用户的密码' withgrant option;flush privileges;

相关文章
相关标签/搜索