V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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
noobma
V2EX  ›  MySQL

mysql 启动不了

  •  
  •   noobma · 2020-07-14 11:31:16 +08:00 · 3101 次点击
    这是一个创建于 1618 天前的主题,其中的信息可能已经有所发展或是发生改变。

    系统是 debian 10,跟着这个文档下载安装了 mysql 8.0.21, 不过在执行 dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb 的时候有依赖错误,所以我手动拆开成了几条命令先后执行,然后安装也成功了

    dpkg -i mysql-common...deb
    dpkg -i mysql-community-client...deg
    dpkg -i mysql-client...deb
    dpkg -i mysql-community-server...deb
    dpkg -i mysql-server...deb
    

    但是启动的时候报错

    [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21) starting as process 2029
    [System] [MY-011012] [Server] Starting upgrade of data directory.
    [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
    [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
    [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
    [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
    [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
    [ERROR] [MY-010119] [Server] Aborting
    [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL
    

    我跟着错误日志中的链接去设置了 innodb_force_recovery = 1, 再重启 systemctl restart mysql.service , 又报错了

    [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21) starting as process 1169
    [System] [MY-011012] [Server] Starting upgrade of data directory.
    [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    [ERROR] [MY-012936] [InnoDB] Database upgrade cannot be accomplished with innodb_force_recovery > 0
    [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
    [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
    [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
    [ERROR] [MY-010119] [Server] Aborting
    [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL
    

    我是 mysql 菜鸡,技穷了,请各位大佬指点一手,现在是刚安装,没有数据,所以怎么搞都可以🙏

    skiy
        1
    skiy  
       2020-07-14 11:34:32 +08:00
    如果是我,我先用集成包尝试一下。如果能正常安装,那我再去看它的安装脚本是怎么写的。
    justin2018
        2
    justin2018  
       2020-07-14 11:51:00 +08:00
    https://lnmp.org/ 这个可以试一试 😅
    noobma
        3
    noobma  
    OP
       2020-07-14 12:40:53 +08:00
    @skiy
    @justin2018
    谢谢大佬们,把现在的 mysql 删掉,加入 mysql 的源,从源里面重新安装,正常了😅
    wtks1
        4
    wtks1  
       2020-07-14 12:59:24 +08:00 via Android
    其实如果只是尝试一下,完全可以用 docker 来装的,用别人做好的镜像,基本不会出问题
    ZehaiZhang
        5
    ZehaiZhang  
       2020-07-14 13:05:40 +08:00
    一直都是 docker run 出来的🐶
    fhsan
        6
    fhsan  
       2020-07-14 13:05:44 +08:00
    1 如果是我,apt-get
    2 如果是我,make make install
    3 偶尔会 dpkg,毕竟当初就是这样 debian 安装 sougou deb 的
    newtype0092
        7
    newtype0092  
       2020-07-14 13:58:03 +08:00
    你这就是有个旧表数据和新版 MySQL 不兼容啊,如果没有数据就是以前的遗留数据,去 data 文件夹下删空就行。
    zhangysh1995
        8
    zhangysh1995  
       2020-07-14 14:35:47 +08:00
    配置文件写错了吧 => Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
    openbsd
        9
    openbsd  
       2020-07-14 15:04:37 +08:00
    不是 glibc 一把梭吗 ?
    madpecker009
        10
    madpecker009  
       2020-07-14 15:09:40 +08:00
    @justin2018 mac 可以用这个吗?
    noobma
        11
    noobma  
    OP
       2020-07-14 15:46:01 +08:00
    @newtype0092 大佬你这一说,感觉是的,以前有个 mariadb,可能是 maria 的数据
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5401 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:22 · PVG 09:22 · LAX 17:22 · JFK 20:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.