简体   繁体   中英

can't create users or grant privileges on mysql db after reboot

I have a mysql db running on ubuntu server. Originally it was v5.7, then I upgraded it to version 8.0.23. I rebooted my ubuntu server recently, and now I don't seem to be able to create users or grant permissions. I have an example where I tried creating two test users below, but I keep getting this MyISAM related error. Does anyone know what the issue might be, and can you suggest how to fix?

mysql> create user 'testuser1'@'%%' identified by 'test1';
ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. [mysql.user]

I tried the suggestions in this post:

How to fix ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. in Mysql 8.0 after CREATE USER

mysql> alter table mysql.db ENGINE=InnoDB;
Query OK, 7 rows affected (0.10 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> alter table mysql.columns_priv ENGINE=InnoDB;
Query OK, 0 rows affected (0.09 sec)
Records: 0  Duplicates: 0  Warnings: 0

but it didn't seem to fix it

mysql> create user 'test' identified by 'test';

ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. [mysql.user]

I had the same issue.

What worked for me was stopping MySQL service.

service mysqld stop

Then running the following command to force an upgrade of the schemas.

mysqld --upgrade=FORCE

And then starting MySQL service again.

service mysqld start

After that everything started working fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM