In some cases, when you’re trying to reset the MySQL root account password with the –skip-grant-tables option. You get the following error:
ERROR 1290 (HY000): The MariaDB server is running with the –skip-grant-tables option so it cannot execute this statement
To fix it, while you in the safe mode, run the following command to flush the privileges then trying to reset the root password again.
# sudo mysql --user=root mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.8.5-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
MariaDB [mysql]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx';
ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
MariaDB [mysql]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx';
Query OK, 0 rows affected (0.001 sec)
MariaDB [mysql]>
As you can see, the error was gone, and you can reset the root password now.
ADVERTISEMENT
5/5 - (1 vote)