› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
magicdu
V2EX  ›  MySQL

docker 下的 mariadb 10.4.8 断电后崩了,求个恢复的方式

  •  
  •   magicdu ·
    magicdu · Apr 15, 2020 · 5446 views
    This topic created in 2399 days ago, the information mentioned may be changed or developed.

    报错如下:

    [ERROR] Found 1 prepared transactions! It means that mysqld was not shut down properly last time and critical recovery information (last binlog or tc.log file) was manually deleted after a crash. You have to start mysqld with --tc-heuristic-recover switch to commit or rollback pending transactions.
    
    

    配置文件加了:innodb_force_recovery = 1 Google 了下都让使用如下命令,恢复不成功

    mysqld_safe --tc-heuristic-recover=COMMIT
    
    
    
    16 replies  •  2020-05-28 14:41:52 +08:00
    defunct9
    defunct9
    Apr 15, 2020
    1
    开 ssh,让我上去看看
    magicdu
    magicdu
    OP
    Apr 15, 2020
    2
    @defunct9 老哥,你每个帖子都是这么回的,我都看到你好几回了
    defunct9
    defunct9
    Apr 15, 2020
    3
    @magicdu 是的,你要继续翻会看到更多的。
    sprite82
    sprite82
    Apr 15, 2020 via Android
    4
    不是很理解为什么数据库也要放 docker 中
    littlewing
    littlewing
    Apr 15, 2020
    5
    恢复不成功报什么错?
    gz911122
    gz911122
    Apr 15, 2020
    6
    @defunct9 那你这样的意义是啥?
    gz911122
    gz911122
    Apr 15, 2020
    7
    @defunct9 顺便说句你头像也太丑了...不能换个好看的么
    gz911122
    gz911122
    Apr 15, 2020
    8
    @defunct9 当然如果是亲人当我没说.
    magicdu
    magicdu
    OP
    Apr 15, 2020
    9
    @littlewing 感谢回复,数据已经恢复了,把 data 数据文件拷出来了在本地恢复的,容器里不好搞,报了个这样的错 [ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'。
    之后用下面的命令启动起来了
    ```
    /usr/sbin/mysqld --skip-grant-tables --general-log &
    ```
    然后把数据搞出来了,感觉稀里糊涂的还是。
    xfriday
    xfriday
    Apr 15, 2020
    10
    手动删掉那个 prepared transaction
    defunct9
    defunct9
    Apr 15, 2020❤️3
    11
    @gz911122 猜测没有意义,上去看了才知道真正原因。头像么,小娃照片,话说你小时候也是一样丑。
    gz911122
    gz911122
    Apr 15, 2020
    12
    @defunct9 这倒没有.
    neroxps
    neroxps
    Apr 15, 2020
    13
    楼主 docker -v 没用???数据库文件直接在容器内部???勇气可嘉

    docker rm -f 不就 GG 了?
    idealhs
    idealhs
    Apr 15, 2020❤️1
    14
    这楼里互动属实给我看笑了😂
    magicdu
    magicdu
    OP
    Apr 15, 2020
    15
    @neroxps 当然 得 -v 了
    kljsandjb
    kljsandjb
    May 28, 2020 via iPhone
    16
    @magicdu 已经把这货屏蔽了 头像太🐔儿丑+评论太烦人
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4061 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 06:51 · PVG 14:51 · LAX 22:51 · JFK 01:51
    ♥ Do have faith in what you're doing.