cloudpanel-io / cloudpanel-ce

1.28k stars 106 forks source link

MariaDB errors after starting the service #413

Closed mrtzd closed 9 months ago

mrtzd commented 9 months ago

CloudPanel version(s) affected

v2.4.1

Description

Here are the logs of maraidb service after start (running on Ubuntu Server 22.04):

Jan 27 19:01:16 ubuntu systemd[1]: Starting MariaDB 10.6.12 database server...
Jan 27 19:01:16 ubuntu mariadbd[241051]: 2024-01-27 19:01:16 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 65535)
Jan 27 19:01:18 ubuntu systemd[1]: Started MariaDB 10.6.12 database server.
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241071]: Upgrading MySQL tables if necessary.
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241074]: Looking for 'mariadb' as: /usr/bin/mariadb
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241074]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241074]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241074]: FATAL ERROR: Upgrade failed
Jan 27 19:01:18 ubuntu /etc/mysql/debian-start[241080]: Checking for insecure root accounts.
Jan 27 19:01:18 ubuntu debian-start[241083]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I'm using the default configuration on a fresh installation of CloudPanel.

How to reproduce

  1. Install CloudPanel on a fresh installation of Ubuntu Server 22.04. (choose MariaDB 10.11 or 10.6 as the Database Engine)
  2. After the installation has finished restart the mariadb service with systemctl restart mariadb
  3. Check the logs of mariadb service to see the error with systemctl status mariadb

Possible Solution

Ok I've found a possible workaround for this issue. I changed the contents of the /etc/mysql/debian.cnf file like this:

[client]
host     = 127.0.0.1
user     = root
password = your_root_password
socket   = /var/run/mysqld/mysqld.sock

[mysql_upgrade]
host     = 127.0.0.1
user     = root
password = your_root_password
socket   = /var/run/mysqld/mysqld.sock

Additional Context

No response

it2ready commented 9 months ago

not working solution

cloudpanel-io commented 9 months ago

Not a CloudPanel problem. Please report this to mariadb.

mrtzd commented 9 months ago

Not a CloudPanel problem. Please report this to mariadb.

How is this not a CloudPanel issue? This only happens because of the way CloudPanel installs and configures mariadb by default. I don't think this error happens if I install mariadb manually on a system without CloudPanel.