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

不羁岁月 提交于 2021-01-27 04:37:34

问题


I have an installation of Debian Stretch and a new installation of Mysql 8.0 (no changes in configuration yet). When I try to create a new user with:

mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'xyz';

I got the following:

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

Any suggestion about what the problem could be?

Thank you


回答1:


I had restored a DB backup into my new dev MySQL 8 system without thinking and overwrote the MySQL database tables. It wasn't that hard to fix but just took a bit of hacking at it for a while and this is what fixed it.

alter table mysql.db ENGINE=InnoDB;
alter table mysql.columns_priv ENGINE=InnoDB;

after that, I was able to create a user with no problems.

The key was in the error message.

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

So I knew it was mysql.db that was MyISAM and needed to be something else so I just changed it to InnoDB.

Hope that helps someone!

If your MySQL database is the wrong type that will work or the other alternative would be to initialize your db

mysqld --initialize

That'll recreate it all. If you can dump the SQL before you do that it's always best.




回答2:


You should maybe consider moving away from MyISAM. InnoDB is the default engine in MySQL since 5.6, MySQL 8.0 will be the last version that has limited support for it.

You can read up on the details in this Percona blog post




回答3:


I ran into the same problem after a fresh installation of MySQl 8.0 followed by reloading an old (v 5.7) dump file. Solution was to delete and reinstall MySQL and this time created a new dump file from the 5.7 MySQL containing only my own tables excluding system tables and imported them into the v 8.0 MySQL. Everything works flawlessly.




回答4:


Different solution: I had a MySQL dump of all my databases from MySQL 5.7, including the mysql table. After importing the whole dump folder (including this mysql table) I got this error. After a complete reinstall of MySQL 8.0.21 and removing the mysql table from the dump folder everything worked as expected.



来源:https://stackoverflow.com/questions/54292491/how-to-fix-error-1726-hy000-storage-engine-myisam-does-not-support-system-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!