Comments - Troubleshooting Connection Issues

2 years, 1 month ago Nick Chomey

Sorry, I can't figure out where to post this question and this seems as good as anywhere...

There appears to be an error with MariaDB when installed on Ubuntu 18.04 and 20.04. It does not happen with AlmaLinux. With a fresh install of either and apt install mariadb, if you run systemctl status mariadb, it says the following:

Mar 17 17:41:13 guest /etc/mysql/debian-start[45645]: Upgrading MySQL tables if necessary. 
Mar 17 17:41:13 guest /etc/mysql/debian-start[45649]: Looking for 'mysql' as: /usr/bin/mysql 
Mar 17 17:41:13 guest /etc/mysql/debian-start[45649]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck 
Mar 17 17:41:13 guest /etc/mysql/debian-start[45649]: This installation of MariaDB is already upgraded to 10.3.34-MariaDB. 
Mar 17 17:41:13 guest /etc/mysql/debian-start[45649]: There is no need to run mysql_upgrade again for 10.3.34-MariaDB. 
Mar 17 17:41:13 guest /etc/mysql/debian-start[45649]: You can use --force if you still want to run mysql_upgrade

This implies that it is trying to run mysql_upgrade when it shouldn't be. This issue is further compounded when I install CyberPanel, which seems to change something such that it tries to run mysql_upgrade without the root password. That results in these messages

Mar 17 15:47:53 intel-high-freq systemd[1]: Starting MariaDB 10.3.34 database server... 
Mar 17 15:47:54 intel-high-freq mysqld[1037]: 2022-03-17 15:47:54 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0ubuntu0.20.04.1) starting as process 1037 ... 
Mar 17 15:47:55 intel-high-freq systemd[1]: Started MariaDB 10.3.34 database server. 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1213]: Upgrading MySQL tables if necessary. 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1221]: Looking for 'mysql' as: /usr/bin/mysql 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1221]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1221]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1221]: FATAL ERROR: Upgrade failed 
Mar 17 15:47:55 intel-high-freq /etc/mysql/debian-start[1263]: Checking for insecure root accounts. 
Mar 17 15:47:55 intel-high-freq debian-start[1268]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Websites work on the server, so MariaDB is working fine. So perhaps this is just an issue with systemctl status mariadb...

You can see more about all of this in the CyberPanel forum here: https://community.cyberpanel.net/t/mariadb-errors-on-ubuntu-20-04-only-when-using-cyberpanel/20345

 
1 year, 10 months ago Stephen Fletcher

You could edit /etc/mysql/debian-start to not run the function "upgrade_system_tables_if_necessary" (or edit the packages mysql.service unit file in /etc/systemd/system/ to not run the script by removing the line "ExecStartPost=/etc/mysql/debian-start" but this will stop two other checks from running as well...)

It means on upgrading the Mysql service to a newer version you may need to manually run an upgrade command to get functions etc working again. Not sure what else it may impact but I assume thats it. Its like this in the upstream mariaDB supplied .deb package

Annoying that it looks like an error on every start of the database but I think I will just leave it how it is

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.