mariadb root cannot be accessed locally

./mysqld_safe --skip-grant-tables;

mysql -u root -p

use mysql;

update user set host='localhost' where user='root' and host='host';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges

Guess you like

Origin blog.csdn.net/myidea999/article/details/111256046