The issue where aaPanel shows the wrong MySQL/MariaDB status in the interface may be related to how aaPanel detects service information based on the server hostname.
In my case, after changing the server hostname without synchronizing the MySQL/MariaDB configuration, aaPanel continued to read the service status, PID file, or error log using a different hostname. As a result, the aaPanel interface showed an incorrect status, for example MySQL was actually running, but the panel displayed it as stopped. The Error Log section also did not show the correct log file.
My solution was to create the correct PID and error log files based on the new hostname, then update the MySQL/MariaDB configuration file.
For example, replace your_domain_name with your actual server hostname or domain name:
pid-file=/www/server/data/your_domain_name.pid
log-error=/www/server/data/your_domain_name.err
Example:
pid-file=/www/server/data/panel.your_domain_name.com.pid
log-error=/www/server/data/panel.your_domain_name.com.err
Create the error log file if it does not already exist:
touch /www/server/data/your_domain_name.err
chown mysql:mysql /www/server/data/your_domain_name.err
chmod 660 /www/server/data/your_domain_name.err
Then restart MySQL/MariaDB and aaPanel:
bt restart mysql
bt restart
Or use systemctl:
systemctl restart mysqld
systemctl restart bt
After that, verify the service status:
systemctl status mysqld --no-pager
mysqladmin ping
If the result shows active (running) and mysqld is alive, MySQL/MariaDB is running correctly.
After applying these changes, aaPanel was able to detect the correct service status and display the correct Error Log file.
I hope aaPanel can add this solution to the documentation or troubleshooting notes, so other users who change their server hostname will know that they also need to synchronize pid-file and log-error in the MySQL/MariaDB configuration. This can help prevent incorrect service status and error log display issues in the aaPanel interface.