You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Nginx服务器上启动MariaDB服务?启动失败求助

Troubleshooting MariaDB Startup Failure (Exit Code 1 in mariadb-wait-ready)

Hey there, let’s work through this MariaDB startup issue together. Looking at your systemd logs, the key problem here is that the mariadb-wait-ready post-start process exited with status 1—even though mysqld_safe launched successfully. This usually means the MySQL daemon crashes right after starting, before the readiness check can complete. Here are actionable steps to diagnose and fix this:

  • Check the full MariaDB error log
    The systemd logs only give a high-level overview—your /var/log/mariadb/mariadb.log will have detailed, daemon-specific error messages. Run this command to view it:

    cat /var/log/mariadb/mariadb.log
    

    Look for lines starting with [ERROR]—common issues include permission errors on data files, corrupted tables, or invalid configuration settings.

  • Verify data directory permissions
    MariaDB needs exclusive access to its data directory (/var/lib/mysql). Check the owner and permissions with:

    ls -ld /var/lib/mysql
    

    The directory should be owned by the mysql user and group. If not, fix it with:

    chown -R mysql:mysql /var/lib/mysql
    chmod 750 /var/lib/mysql
    
  • Check for disk space issues
    A full disk can prevent MariaDB from writing logs or creating temporary files. Verify your disk usage with:

    df -h
    

    Make sure the partition containing /var (where logs and data live) has free space available.

  • Test your MariaDB configuration
    Invalid settings in my.cnf (typically located at /etc/my.cnf or /etc/mysql/my.cnf) can cause the daemon to crash on startup. Try running the MySQL daemon directly to see immediate, detailed errors:

    /usr/bin/mysqld --basedir=/usr
    

    If configuration errors show up, temporarily rename the config file to test with default settings:

    mv /etc/my.cnf /etc/my.cnf.backup
    systemctl start mariadb
    

    If it starts successfully, you’ll need to debug the old config file line by line to find the faulty setting.

  • Clean up stale PID files
    Sometimes a leftover PID file can confuse systemd. Remove it and try starting the service again:

    rm -f /var/run/mariadb/mariadb.pid
    systemctl start mariadb
    

After trying these steps, check the service status again with systemctl status mariadb to see if it’s running. If you find specific error messages in the log, feel free to share them and we can narrow down the fix further!

内容的提问来源于stack exchange,提问作者Pushker Tiwari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:48:35