mysql5.7报错 1546、1577和1682问题分析

环境说明:
MySQL5.6.40 上xtrabackup全备备份的数据导入到mysql5.7.24实例上,启动MySQL5.7的服务,登录数据库MySQL5.7实例。但是在drop user [email protected]‘127.0.0.1‘时,报错如下:

2019-08-15T19:02:31.160910+08:00 1546 [ERROR] /usr/local/mysql5.7/bin/mysqld: Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 50640, now running 50724. Please use mysql_upgrade to fix this error.

mysql实例版本如下:

[[email protected] ~]# /usr/local/mysql/bin/mysqld -V
/usr/local/mysql/bin/mysqld  Ver 5.6.40 for Linux on x86_64 (Source distribution)
[[email protected] ~]# /usr/local/mysql5.7/bin/mysqld -V
/usr/local/mysql5.7/bin/mysqld  Ver 5.7.24 for linux-glibc2.12 on x86_64 (MySQL Community Server (GPL))

解决办法:升级下MySQL5.7


/usr/local/mysql5.7/bin/mysql_upgrade -uroot -p‘ln.orge#dieurw5199‘ -S /tmp/3306.sock
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.

testdb29.dtr_wx_gotourl                             OK
testdb29.dtr_zone                                   OK
testdb29.hm_planstats_h                            OK
Upgrade process completed successfully.
Checking if update is needed.

登录MySQL5.7删除库的用户,删除成功

mysql> drop user [email protected]‘127.0.0.1‘;
Query OK, 0 rows affected (0.00 sec)

提示:此时的mysql5.7.24实例并没有重启

此刻创建一个定时器调用存储过程时,报错如下:

mysql> CREATE EVENT test1
    -> ON SCHEDULE EVERY 2 second STARTS TIMESTAMP ‘2019-08-10 16:16:22‘
    -> ON COMPLETION PRESERVE
    -> DO
    -> BEGIN
    -> CALL test1();
    -> END//

ERROR 1577 (HY000): Cannot proceed because system tables used by Event Scheduler were found damaged at server start
mysql> show events;
ERROR 1577 (HY000): Cannot proceed because system tables used by Event Scheduler were found damaged at server start

###提示无法继续,因为在服务器启动时发现事件调度程序使用的系统表已损坏

此刻查看mysql 系统变量报错如下:

mysql> show variables like ‘event_scheduler‘;
ERROR 1682 (HY000): Native table ‘performance_schema‘.‘session_variables‘ has the wrong structure

出现的原因是我升级了mysql的版本,但是没有重启mysql实例
需要重启MySQL5.7.24服务。否则会导致MySQL的部分系统表识别不到。

service restart mysql5.7.24

到此处问题解决了

mysql> show events;
Empty set (0.00 sec)

mysql> show variables like ‘event_scheduler‘;
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | ON    |
+-----------------+-------+
1 row in set (0.01 sec)

从新创建定时器,执行成功:

mysql> CREATE PROCEDURE test1()
    -> BEGIN
    -> INSERT INTO tb01(username,password,create_time) values(‘李四‘, ‘张三‘,now());
    -> END//
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE EVENT test1
    -> ON SCHEDULE EVERY 5 second STARTS TIMESTAMP ‘2019-08-16 17:34:22‘
    -> ON COMPLETION PRESERVE
    -> DO
    -> BEGIN
    -> CALL test1();
    -> END//
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> select now();

原文地址:https://blog.51cto.com/wujianwei/2430245

时间: 2024-09-28 20:53:59

mysql5.7报错 1546、1577和1682问题分析的相关文章

MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

MySQL5.7 报错 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement 需要重新设置密码.那我们就重新设置一下密码,命令如下: set password = password('123456'); 原文地址:https://www.cnblogs.com/Dev0ps/p/11738557.html

TP3.2项目 MySQL5.7报错1055 group by新特性

TP3.2项目中本来使用的是mysql5.6进行开发,切换到5.7之后,突然发现原来的一些sql运行都报错,错误编码1055,错误信息和sql_mode中的"only_full_group_by"有关,到网上看了原因,说是mysql5.7中only_full_group_by这个模式是默认开启的 ,网上给了很多解决办法,因为我用的是WAMP集成环境,我的解决办法如下: 点击MySQL选择MySQL settings ->选择sql-mode->选择sql-none和sql-

安装mysql5.6报错问题统计点

报错1(su进入mysql属组时报错): [[email protected] ~]# su - mysql Last login: Thu Aug 31 17:20:03 CST 2017 on pts/1 su: warning: cannot change directory to /home/mysql: No such file or directory -bash-4.2$ exit 解决方法: [[email protected] ~]# cd /home [[email prot

MySQL5.7报错[ERROR] Unix socket lock file is empty /tmp/mysql.sock.lock的解决方法

发现MySQL服务器因系统磁盘写满导致服务停了,清理磁盘后启动服务时无法正常启动,查看localhost.err日志发现如下报错: [ERROR] Unix socket lock file is empty /tmp/mysql.sock.lock 解决: 查看该文件发现确实是空文件,删除该文件后再启动服务已经可以正常启动.参考链接 https://blog.csdn.net/qq_36183569/article/details/83022519 总结: mysql.sock.lock是可读

sql_mode=ONLY_FULL_GROUP_BY 导致lepus监控mysql5.7报错

lepus监控mysql5.7出现的问题: 2017-09-12 12:18:53 [INFO] check mysql controller finished. [WARNING] check mysql 192.168.10.9:3306 failure: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'information_schema.proce

MySQL5.7报错

mysql 配置文件目录:/etc/my.cnf root 密码为空的时候配置文件中下面这句: skip-grant-tables GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY '123' WITH GRANT OPTION; 执行这句时候错误: ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute

IOS运行报错 "dyld: Library not loaded" 原因分析

我们的游戏IOS版在接入易接SDK后,启动出现如下错误 dyld: Library not loaded: @rpath/OnlineAHelper.framework/OnlineAHelper Referenced from: /var/mobile/Containers/Bundle/Application/35ED2A71-7F60-4A16-BA4C-ECD6493A1EE1/yzg.app/yzg Reason: no suitable image found. Did find:

部署PID在启动ShareTeam.exe报错

一切环境准备就绪但是在启动ShareTeam.exe的时候报错如下: 根据原因进行分析:{1.看.net服务是否开启,如果开启的话.检查.net是否安装全.从.net 1.0到4.0最好都安装下} 如上图..net环境都部署好了之后.再重启ShareTeam.exe就不会报错了如下图:

IE浏览器报错 ‘Rowspan’ 为空或不是对象

摘自   http://blog.csdn.net/zxygww/article/details/46635403 环境: EasyUI 1.4.2. 现象: 在使用JQuery EasyUI 的datagrid控件时,使用动态指定columns的方式,相关代码如下: $("#topApList").datagrid({columns:[[{field:'aaa',title: 'aaa',align: 'center',width: 130},  {field:'bbb',title