Ubuntu系统中MySQL启动失败:OpenStack配置后重启受阻
Let’s work through why your MariaDB service won’t restart after adding the OpenStack-specific config file. Here are the most common issues and actionable fixes:
1. First, Grab the Exact Error Logs
You can’t diagnose the problem without knowing what’s breaking. Start by checking the service logs to get clear failure details. Run either of these commands (depending on your Ubuntu version):
sudo journalctl -u mariadb.service # OR sudo cat /var/log/mysql/error.log
Look for lines like Can't bind to address or Unknown system variable—these will point directly to the root cause.
2. Verify the bind-address Setting
The most frequent culprit here is an invalid IP in your config. You set bind-address = 10.0.0.11, so:
- Confirm your server actually has this IP assigned to a network interface. Run this to check:
ip addr show - If the IP doesn’t exist, either add it to your server’s network interface, or update the
bind-addressin/etc/mysql/mariadb.conf.d/99-openstack.cnfto a valid IP (like your server’s actual internal IP, or0.0.0.0to allow connections from any address—note:0.0.0.0is not recommended for production environments).
3. Check Config File Syntax & Typos
Even small typos in the config will prevent MariaDB from starting:
- Double-check all parameter names: for example,
innodb_file_per_tableis correct (no missing letters),character-set-server = utf8is valid. - Ensure each parameter is on its own line under the
[mysqld]section—no line breaks in parameter values.
4. Fix Config File Permissions
MariaDB requires strict permissions on config files to run safely. Make sure your 99-openstack.cnf has the right ownership and mode:
sudo chown root:root /etc/mysql/mariadb.conf.d/99-openstack.cnf sudo chmod 644 /etc/mysql/mariadb.conf.d/99-openstack.cnf
5. Look for Conflicting Configurations
Older config files in /etc/mysql/mariadb.conf.d/ or /etc/mysql/my.cnf might have duplicate parameters that clash with your new OpenStack settings. For example, if another file already sets bind-address, this could cause a conflict. Search for duplicates with:
grep -r "bind-address" /etc/mysql/
If you find duplicates, either remove them from the older files or confirm your 99-openstack.cnf takes precedence (higher-numbered config files override lower ones in MariaDB).
Test the Restart
Once you’ve fixed the issue identified in the logs, try restarting the service again:
sudo service mysql restart
If it starts successfully, verify it’s running with:
sudo service mysql status
内容的提问来源于stack exchange,提问作者chris peckham

