mysql1805_错误1805(HY000):mysql.user的列数错误。预期为43,发现为45。表可能已损坏...

bd96500e110b49cbb3cd949968f18be7.png

After a migration from mariadb to mysql-community, I have this error when I try to grant new users:

ERROR 1805 (HY000): Column count of mysql.user is wrong. Expected 43,

found 45. The table is probably corrupted

As I got the backup from as server I didn't own, I do'nt know the exact version of maria-db. But my mysql-server version is: community-server-5.6.38-2

解决方案

I tried the solution posted on a lot of forums

mysql_upgrade --force -uroot -p

But this didn't give the expected results.

So I comparated the fields list from a brand new mysql community server and mine. And discovered that the 3 problematic fields where:

is_role

default_role

max_statement_time

So I did:

mysql -e "ALTER TABLE mysql.user DROP COLUMN is_role, DROP default_role, DROP max_statement_time" -uroot -p

And this worked

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值