MariaDB忘记root密码
vim /etc/my.cnf
加入这一行在28行
skip-grant-tables
保存退出VIM编辑器
进入MariaDB
mysql use mysql show tables ; UPDATE user SET Password = password ("123456") WHERE User = 'root' ; //用户为root,密码为123456 flush privileges; exit systemctl restart mariadb.service

浙公网安备 33010602011771号