标签:table ble set use 连接 完成后 数据 pass 忘记
首先停掉mysql服务,在/etc/my.cnf中添加 skip-grant-tables,同时可以添加skip-networking选项来禁用网络功能,防止这时其他人通过网络连接到数据库
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links=0 skip-grant-tables #添加这一行 skip-networking #添加这一行
之后就可以修改密码了
MariaDB [mysql]> UPDATE mysql.user SET password=PASSWORD(‘1‘) WHERE user=‘root‘; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0
修改完成后记得把配置文件改回来
标签:table ble set use 连接 完成后 数据 pass 忘记
原文地址:https://www.cnblogs.com/forlive/p/9768059.html