Troubleshooting MySQL Startup Failure: No Logs and Rejected Upstart Message


11 views

When MySQL refuses to start without any log entries and throws cryptic Upstart errors, it can be particularly frustrating. Here's what you're likely seeing:

$ sudo service mysql start
start: Job failed to start

Before diving deep, perform these quick checks:

# Check disk space (you mentioned this is okay)
df -h

# Verify MySQL configuration
sudo mysqld --verbose --help | grep -A 1 "Default options"

The key error in your case appears to be:

start: Rejected send message, 1 matched rules

This suggests a permission/initialization issue between systemd and Upstart. Modern Ubuntu systems often have this conflict.

Try bypassing the service wrapper:

# Direct mysqld start attempt
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

When logs are empty, force verbose logging:

sudo mysqld --verbose --log-error=/var/log/mysql/error.log

Even if you've checked permissions, these are often the culprit:

# Critical permission checks
sudo chown -R mysql:mysql /var/lib/mysql
sudo chmod -R 755 /var/lib/mysql

MySQL might be failing due to config issues:

# Test configuration without starting
sudo mysqld --defaults-file=/etc/mysql/my.cnf --validate-config

If all else fails, try these nuclear options:

# Complete purge (will remove all databases)
sudo apt-get purge mysql-server mysql-client mysql-common
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get install mysql-server

For Ubuntu 16.04+ systems with systemd:

# Bypass Upstart entirely
sudo systemctl start mysql
journalctl -xe  # Check system logs

When sudo service mysql start returns that dreaded "Job failed to start" message with empty logs, even experienced DBAs can feel lost. Here's how I systematically debugged this issue:

# Check if MySQL is actually running
ps aux | grep mysqld

# Verify disk space (though OP confirmed 1GB available)
df -h

# Check for alternative log locations
grep -r "ERROR" /var/log/

While permissions might seem correct on the surface, these commands often reveal hidden issues:

# Check apparmor status
sudo aa-status

# Verify mysql user permissions
sudo -u mysql stat /var/lib/mysql

# Check systemd journal (often contains clues journalctl won't show)
sudo journalctl -xe -u mysql.service

The error suggests a conflict between init.d and Upstart systems. Try these alternatives:

# Bypass the service wrapper
sudo /usr/sbin/mysqld --console

# Force systemd to show output
sudo systemctl start mysql.service --no-pager

# Check for corrupt tables (run as mysql user)
sudo -u mysql mysqlcheck --all-databases --check

When standard methods fail, these nuclear options often work:

# Create a new error log file manually
sudo touch /var/log/mysql/error.log
sudo chown mysql:mysql /var/log/mysql/error.log

# Reset Upstart configuration
sudo initctl reload-configuration

# Reinitialize data directory (WARNING: backup first)
sudo mysql_install_db --user=mysql

Implement these in your monitoring:

#!/bin/bash
# Basic MySQL health check script
if ! systemctl is-active --quiet mysql; then
  echo "$(date) - MySQL not running" >> /var/log/mysql_watchdog.log
  systemctl restart mysql
fi