Topic: FATAL ERROR: Upgrade failed When MySQL Starts
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable Installer
- Linux/BSD distribution name and version: Ubuntu 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Using systemctl status mysql I noticed the following errors:
: 2021-03-23 19:27:04 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0ubuntu0.20.04.1) starting as process 792 ...
systemd[1]: Started MariaDB 10.3.25 database server.
/etc/mysql/debian-start[935]: Upgrading MySQL tables if necessary.
/etc/mysql/debian-start[940]: Looking for 'mysql' as: /usr/bin/mysql
/etc/mysql/debian-start[940]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
/etc/mysql/debian-start[940]: Version check failed. Got the following error when calling the 'mysql' command line client
/etc/mysql/debian-start[940]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
/etc/mysql/debian-start[940]: FATAL ERROR: Upgrade failed
/etc/mysql/debian-start[981]: Checking for insecure root accounts.
debian-start[984]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
But using mysqlcheck -u root --all-databases from the command prompt works as expected. I assume the root password is being retrieved from /root/.my.cnf.
However, /etc/mysql/debian-start uses /etc/mysql/debian.cnf as the defaults file, but /etc/mysql/debian.cnf doesn't contain the root password. If I add the root password to /etc/mysql/debian.cnf and restart mysql it works and I get:
/etc/mysql/debian-start[3102]: vmail.recipient_bcc_domain OK
/etc/mysql/debian-start[3102]: vmail.recipient_bcc_user OK
/etc/mysql/debian-start[3102]: vmail.sender_bcc_domain OK
/etc/mysql/debian-start[3102]: vmail.sender_bcc_user OK
/etc/mysql/debian-start[3102]: vmail.sender_relayhost OK
/etc/mysql/debian-start[3102]: vmail.share_folder OK
/etc/mysql/debian-start[3102]: vmail.used_quota OK
/etc/mysql/debian-start[3102]: Phase 7/7: Running 'FLUSH PRIVILEGES'
/etc/mysql/debian-start[3102]: OK
/etc/mysql/debian-start[3139]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
My question is, is it OK to have the root password in /etc/mysql/debian.cnf or should I change references to /etc/mysql/debian.cnf in the file /etc/mysql/debian-start to point to /root/.my.cnf instead which already contains the root password?
Thanks, Steve.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.