虚拟机里的MariaDB忘记密码了,连接不上,只能重置MariaDB的密码,步骤参考网络 [root@localhost ~]# mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) [root@localhost ~]# mysql -uroot -p Enter password: ERROR 1045 (28000
1://免密码登陆 找到mysql配置文件:my.cnf, 在[mysqld]模块添加:skip-grant-tables 保存退出: 2://使配置生效 重启mysql服务: service mysqld restart: 3://将旧密码置空 mysql -u root -p //提示输入密码时直接敲回车. //选择数据库 use mysql //将密码置空 update user set authentication_string = '' where user = 'root