V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
monkeydev
V2EX  ›  问与答

mysql 无论如何都启动不了

  •  
  •   monkeydev · 2020-09-08 01:38:49 +08:00 · 1423 次点击
    这是一个创建于 1541 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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   ·   实用小工具   ·   4884 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 10:00 · PVG 18:00 · LAX 02:00 · JFK 05:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.