重装MariaDB后启动失败:mariadb.service报错求助
Looking at your systemd status logs, the critical error here is:
Process: 10036 ExecStartPost=/etc/mysql/debian-start (code=exited, status=203/EXEC)
A 203/EXEC status typically means the system can't run the specified script—either the file is missing, permissions are incorrect, or leftover MySQL configuration is interfering with your fresh MariaDB install. Let's walk through targeted fixes step by step:
Step 1: Check the debian-start script's existence and permissions
First, confirm the script is present and accessible:
ls -l /etc/mysql/debian-start
- If the file doesn't exist: Your MariaDB installation likely missed this critical component. We'll reinstall core packages to restore it.
- If the file exists: Ensure it has
755permissions and is owned byroot:root. Fix permissions with:
sudo chmod 755 /etc/mysql/debian-start sudo chown root:root /etc/mysql/debian-start
Step 2: Reinstall MariaDB core packages
If the script is missing or permission fixes don't resolve the issue, reinstall the main MariaDB packages to restore all default files:
sudo apt-get install --reinstall mariadb-server mariadb-common
This command will redownload and deploy all necessary components, replacing any missing or corrupted files.
Step 3: Clean up residual MySQL/MariaDB data and configs
Since you uninstalled MySQL first, leftover files might be causing conflicts. Let's wipe them and reinitialize MariaDB:
- Backup your current config (optional but recommended):
sudo cp -r /etc/mysql /etc/mysql_backup
- Delete all existing MariaDB/MySQL data and config directories:
sudo rm -rf /etc/mysql sudo rm -rf /var/lib/mysql
- Reinitialize the MariaDB database:
sudo mariadb-install-db --user=mysql --datadir=/var/lib/mysql
- Try starting the service again:
sudo systemctl start mariadb
Step 4: Remove conflicting systemd drop-in config
Your status shows a migrated config from MySQL: /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf. This might have incompatible settings for MariaDB:
- Backup the config first:
sudo cp /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /tmp/
- Delete the conflicting drop-in:
sudo rm /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
- Reload systemd and restart MariaDB:
sudo systemctl daemon-reload sudo systemctl start mariadb
Verify the Fix
Check if MariaDB is running with:
sudo systemctl status mariadb
If you see active (running), you're all set. You can also test logging in to confirm functionality:
sudo mariadb -u root -p
内容的提问来源于stack exchange,提问作者Med Farih

