mysql 无论如何都启动不了 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
monkeydev
V2EX    问与答

mysql 无论如何都启动不了

  •  
  •   monkeydev 2020-09-08 01:38:49 +08:00 1782 次点击
    这是一个创建于 1908 天前的主题,其中的信息可能已经有所发展或是发生改变。
    200907 17:36:42 [Note] Plugin 'FEDERATED' is disabled.
    /www/server/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
    200907 17:36:42 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    200907 17:36:42 InnoDB: The InnoDB memory heap is disabled
    200907 17:36:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    200907 17:36:42 InnoDB: Compressed tables use zlib 1.2.11
    200907 17:36:42 InnoDB: Initializing buffer pool, size = 256.0M
    200907 17:36:42 InnoDB: Completed initialization of buffer pool
    InnoDB: The first specified data file /www/server/data/ibdata1 did not exist:
    InnoDB: a new database to be created!
    200907 17:36:42 InnoDB: Setting file /www/server/data/ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    200907 17:36:42 InnoDB: Log file /www/server/data/ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file /www/server/data/ib_logfile0 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    200907 17:36:42 InnoDB: Log file /www/server/data/ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file /www/server/data/ib_logfile1 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Doublewrite buffer created
    InnoDB: 127 rollback segment(s) active.
    InnoDB: Creating foreign key constraint system tables
    InnoDB: Foreign key constraint system tables created
    200907 17:36:42 InnoDB: Waiting for the background threads to start
    200907 17:36:43 InnoDB: 5.5.62 started; log sequence number 0
    200907 17:36:43 [Note] Recovering after a crash using mysql-bin
    200907 17:36:43 [Note] Starting crash recovery...
    200907 17:36:43 [Note] Crash recovery finished.
    200907 17:36:43 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
    200907 17:36:43 [Note] - '0.0.0.0' resolves to '0.0.0.0';
    200907 17:36:43 [Note] Server socket created on IP: '0.0.0.0'.
    200907 17:36:43 [Warning] Insecure configuration for --pid-file: Location '/www/server/data' in the path is accessible to all OS users. Consider choosing a different directory.
    200907 17:36:43 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

    不知道这是什么情况啊
    google 里面的都试过了
    还是不行 啊
    10 条回复    2020-09-08 09:35:29 +08:00
    wangsongyan
        1
    wangsongyan  
       2020-09-08 05:41:10 +08:00 via iPhone
    Please run mysql_upgrade to create it.
    singerll
        2
    singerll  
       2020-09-08 07:23:21 +08:00 via Android
    mysql_upgrade 好像是只有数据库启动后才能执行吧,把 plugin,host 表从别的库拷过来扔到数据目录,权限改正确,启动一下试试。
    singerll
        3
    singerll  
       2020-09-08 07:26:49 +08:00 via Android
    再不行就把 mysql 这个库的所有表都拷过来。记得好像是个 bug,数据目录本身是存在这个表的,但就是读不到。。。。启动成功后 drop 掉,再执行建表语句创建( mysql 安装文件中有这几个语句)
    vicnicLight007
        4
    vicnicLight007  
       2020-09-08 08:39:01 +08:00 via iPhone
    服务器内存够不够。以前碰到这种,用的 docker
    monkeydev
        5
    monkeydev  
    OP
       2020-09-08 08:39:08 +08:00
    root@ubuntu:~# mysql_upgrade

    Command 'mysql_upgrade' not found, but can be installed with:

    apt install mysql-server-core-5.7
    apt install mariadb-server-core-10.1
    apt install percona-server-server-5.6
    apt install percona-xtradb-cluster-server-5.7

    @wangsongyan
    @singerll
    @singerll
    dzdh
        6
    dzdh  
       2020-09-08 08:53:29 +08:00
    200907 17:36:43 [Warning] Insecure configuration for --pid-file: Location '/www/server/data' in the path is accessible to all OS users. Consider choosing a different directory.

    --

    --pid-file 制定的文件的路径中的位置是所有操作系统用户都可以访问的。考虑选择一个不同的目录
    nutting
        7
    nutting  
       2020-09-08 08:55:13 +08:00
    文件权限问题方向看看
    steptodream
        8
    steptodream  
       2020-09-08 08:58:27 +08:00
    @monkeydev 从错误的路径看 看样子你根本不是用 apt-get 安装的数据库 你很可能用的一键包啥的


    不是 apt-get 安装的 mysql 的命令很可能不在默认 PATH 里 你可以试试 /www/server/mysql/bin/mysql_upgrade
    594duck
        9
    594duck  
       2020-09-08 09:08:33 +08:00
    加一个 skip-grant-tables 重启一下,先把 mysql 启动起来,再把数据备份了,再重新初始化一下 mysql
    monkeydev
        10
    monkeydev  
    OP
       2020-09-08 09:35:29 +08:00
    @steptodream
    root@ubuntu:~# /www/server/mysql/bin/mysql_upgrade
    Looking for 'mysql' as: /www/server/mysql/bin/mysql
    Looking for 'mysqlcheck' as: /www/server/mysql/bin/mysqlcheck
    Error: Failed while fetching Server version! Could be due to unauthorized access.
    FATAL ERROR: Upgrade failed

    报错误
    关于     助文档     自助推广系统     博客     API     FAQ     Solana     2686 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 28ms UTC 13:22 PVG 21:22 LAX 05:22 JFK 08:22
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86