• mysql / mysqld_safe / mysqld 常见错误处理


    1. FATAL ERROR: Could not find ./bin/my_print_defaults

    [root@localhost scripts]# ./mysql_install_db  --user=mysql --datadir=/var/lib/mysql
    FATAL ERROR: Could not find ./bin/my_print_defaults
    
    If you compiled from source, you need to run 'make install' to
    copy the software into the correct location ready for operation.
    
    If you are using a binary release, you must either be at the top
    level of the extracted archive, or pass the --basedir option
    pointing to that location.

    解决方法:

    [root@localhost scripts]# ./mysql_install_db  --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql

    指定 --basedir

    2. ERROR 1665 (HY000)

    (root@localhost)[t]mysql>insert into t(i) values(5);
    ERROR 1665 (HY000): Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT 
    and at least one table uses a storage engine limited to row-based logging.
    InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

    RC隔离级别时,binary log的格式只能使用 row based logging。不能使用 statement 格式的个binary log。

    5.6.15-log 版本的还是可以的:RC隔离级别可以设置 binlog_format=statement;

    但是在5.6.26-log 版本测试,RC隔离级别不能设置binlog_format=statement; 只能使用 binlog_format=row;

    不知道具体从哪个版本开始不允许的。

    3. mysqlbinlog 报错 ERROR: Error in Log_event::read_log_event(): 'Sanity check failed':

    [root@localhost ~]# mysqlbinlog /backup/xtrabackup/mysql-bin.000002 --start-position=482 > bin.sql
    ERROR: Error in Log_event::read_log_event(): 'Sanity check failed', data_len: 65, event_type: 32
    ERROR: Could not read entry at offset 592: Error in log format or read error.
    

    mysqlbinlog 调用的版本错了,默认调用的是系统中libmyqlclient中的了,和最新版的binlog不兼容,解决办法指定mysqlbinlog目录:

    [root@localhost ~]# /usr/local/mysql/bin/mysqlbinlog /backup/xtrabackup/mysql-bin.000002 --start-position=482 > bin.sql
    [root@localhost ~]#

    执行成功了。

  • 相关阅读:
    很多人都没用过的轻量级Oracle数据库数据导出工具SQLLDR2——性能超赞
    IT人员必备linux安全运维之Ssh用途、安全性、身份认证以及配置……【转】
    ps aux排序
    Oracle-AWR报告简介及如何生成【转】
    MySQL删除数据几种情况以及是否释放磁盘空间【转】
    MySQL登录问题1045 (28000)处理步骤【原创】
    nginx与PHP的关系和交互方式【转】
    MySQL常见错误代码说明
    xargs -i 和-I 的区别【转】
    linux中的计算【转】
  • 原文地址:https://www.cnblogs.com/digdeep/p/4908353.html
Copyright © 2020-2023  润新知