Please use mysql_upgrade to fix thiserror

本文解决了MySQL更新版本后出现的权限错误问题。通过使用mysql_upgrade命令,成功更新了mysql库,并修复了新旧版本不匹配导致的权限问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mysql在创建用户或者设置权限,操作mysql库时

出现以下错误:

Column count of mysql.useris wrong. Expected 43, found 42. Created with MySQL 50552, nowrunning 50636. Please use mysql_upgrade to fix thiserror.

出现问题的原因:更新mysql版本后出现了新旧版本不匹配的问题!

解决方法:使用命令:mysql_upgrade -u root -p    更新mysql库


Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can beinsecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can beinsecure.
mysql.columns_priv                                OK
mysql.db                                          OK
mysql.event                                       OK
mysql.func                                        OK
mysql.general_log                                 OK
mysql.help_category                               OK
mysql.help_keyword                                OK
mysql.help_relation                               OK
mysql.help_topic                                  OK
mysql.host                                        OK
mysql.ndb_binlog_index                            OK
mysql.plugin                                      OK
mysql.proc                                        OK
mysql.procs_priv                                  OK
mysql.proxies_priv                                OK
mysql.servers                                     OK
mysql.slow_log                                    OK
mysql.tables_priv                                 OK
mysql.time_zone                                   OK
mysql.time_zone_leap_second                       OK
mysql.time_zone_name                              OK
mysql.time_zone_transition                        OK
mysql.time_zone_transition_type                   OK
mysql.user                                        OK
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can beinsecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can beinsecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can beinsecure.
test.stu                                          OK
OK
更新成功!!!!!


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值