gpt4 book ai didi

MySQL 服务器未启动。服务器端SQL语句不好?损坏的表?面板自动更新?

转载 作者:行者123 更新时间:2023-12-04 19:40:02 24 4
gpt4 key购买 nike

昨天,我的专用服务器上的 mysql 服务停止工作,关闭了几个网页和在其上运行的其他应用程序。也许 cpanel 自动更新没有正确完成,但我只收到了带有此错误的警告电子邮件:

(XID ######) The “mysql” service is down.
第一个说:
The subprocess “/usr/local/cpanel/scripts/restartsrv_mysql” reported error number 2 when it ended.
系统和服务器信息:
  • 操作系统:CentOS Linux 8.3
  • Apache 版本:2.4.46
  • MySQL 版本:x86_64 上的 Linux 版本 8.0.25(MySQL 社区服务器 - GPL)
  • PHP 版本:7.4.18
  • 面板 v94.0.8

  • 我将列出我尝试过的一些命令及其输出:
    # systemctl start mysqld
    Job for mysqld.service failed because the control process exited with error code.
    See "systemctl status mysqld.service" and "journalctl -xe" for details.
    然后:
    # systemctl status mysqld.service
    ESCOD
    mysqld.service - MySQL Server
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mysqld.service.d
    └─limits.conf
    Active: failed (Result: exit-code) since Tue 2021-05-11 17:33:19 UTC; 53s ago
    Docs: man:mysqld(8)
    http://dev.mysql.com/doc/refman/en/using-systemd.html
    Process: 27686 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
    Process: 27657 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
    Main PID: 27686 (code=exited, status=1/FAILURE)
    Status: "Server upgrade complete"
    Error: 2 (No such file or directory)

    May 11 17:33:17 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:17.655235Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock>
    May 11 17:33:17 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:17.670697Z 4 [System] [MY-013381] [Server] Server upgrade frrom '80024' to '80025' started.>
    May 11 17:33:18 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:18.064279Z 4 [ERROR] [MY-010725] [Server] Couldn't repair table: mysql.general_log>
    May 11 17:33:18 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:18.064383Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Create general_log CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host MEDIUMTEXT NOT NULL, thread_id BIGINT UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMBLOB NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"; 'failed with error code = 1034, error message = 'Incorrect key file for table 'general_log'; try to repair it'.>>
    May 11 17:33:18 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:18.065026Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade >
    May 11 17:33:18 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:18.065176Z 0 [ERROR] [MY-010119] [Server] Aborting
    May 11 17:33:18 xx-xx-xx-xx.cprapid.com mysqld[27686]: 2021-05-11T17:33:18.987996Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25) MySQL Community Server - GPL.>
    May 11 17:33:19 xx-xx-xx-xx.cprapid.com systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
    May 11 17:33:19 xx-xx-xx-xx.cprapid.com systemd[1]: mysqld.service: Failed with result 'exit-code'.
    May 11 17:33:19 xx-xx-xx-xx.cprapid.com systemd[1]: Failed to start MySQL Server.
    # mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    此文件不存在,但有一个位于 /tmp/mysql.sock .后来,我在 my.cnf 中更改了一些行,但得到了同样的错误
    #mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    # nano /etc/my.cnf

    [client]

    socket=/tmp/mysql.sock

    [mysqld]
    disable-log-bin=1
    default-authentication-plugin=mysql_native_password
    innodb_file_per_table=1
    performance-schema=0
    socket=/tmp/mysql.sock
    如前所述,我更改了 socket=/var/lib/mysql/mysql.socksocket=/tmp/mysql.sock对于客户端和mysqld。不再进行任何更改。
    # mysqld -u root
    2021-05-11T17:11:04.993623Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25) starting as process 25020
    2021-05-11T17:11:04.997863Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    2021-05-11T17:11:05.146263Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
    2021-05-11T17:11:05.432633Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
    2021-05-11T17:11:05.447752Z 4 [System] [MY-013381] [Server] Server upgrade from '80024' to '80025' started.
    2021-05-11T17:11:10.666062Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement 'ALTER TABLE user MODIFY max_updates int unsigned DEFAULT 0 NOT NULL, MODIFY max_connections int unsigned DEFAULT 0 NOT NULL, MODIFY max_user_connections int unsigned DEFAULT 0 NOT NULL, MODIFY ssl_cipher BLOB NOT NULL, MODIFY x509_issuer BLOB NOT NULL, MODIFY x509_subject BLOB NOT NULL; ' failed with error code = 1138, error message = 'Invalid use of NULL value'.
    2021-05-11T17:11:10.666934Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
    2021-05-11T17:11:10.667061Z 0 [ERROR] [MY-010119] [Server] Aborting
    2021-05-11T17:11:12.059278Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25) MySQL Community Server - GPL.
    在这里我觉得很有趣 'ALTER TABLE user MODIFY...它看起来有一个额外的空间(对不起,如果这不重要,我不是这方面的专家)。
    # ls -la /var/lib |grep mysql
    drwxr-x--x 10 mysql mysql 4096 May 12 00:24 mysql
    drwxr-x--- 2 mysql mysql 6 Apr 23 16:18 mysql-files
    drwxr-x--- 2 mysql mysql 6 Apr 23 16:18 mysql-keyring
    最后,在检测到该事件后,服务器在一个小时左右没有响应 ping,需要拔下并重新启动。现在我可以通过 ssh 访问服务器,但 mysql 仍然无法正常工作。

    最佳答案

    如果您打开了“常规日志”,请将其关闭。
    我在更新日志中没有发现任何明显的内容:https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-25.html
    考虑在 bugs.mysql.com 提交错误mysql 中有哪些“一般*”文件目录?可能只删除这些文件。
    更多

    failed with error code = 13, error message

    perror 13
    OS error code 13: Permission denied
    谁在写作?谁在运行 mysqld?等等
    MySQL 应由 root 安装和 mysqld应该由系统进程而不是用户进程运行。

    关于MySQL 服务器未启动。服务器端SQL语句不好?损坏的表?面板自动更新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67492214/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com