[MDEV-22833] Ubuntu 20 and default setup issue Created: 2020-06-08  Updated: 2021-03-10  Resolved: 2021-03-10

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Platform Debian
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Oleksandr Marushchenko Assignee: Otto Kekäläinen
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

mysql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal



 Description   

At default setup Ubuntu creates this file:
/etc/mysql/my.cnf

its a symlink:
/etc/mysql/my.cnf -> /etc/alternatives/my.cnf

So, then you trying to change something in config files you have zero reaction, and you cant debug it by service mariadb restart - it restarts and everything works, but config is ingored because of this:

# mysql -u root -p
Warning: World-writable config file '/etc/mysql/my.cnf' is ignored

So you can spend a hours to guess that is going on.



 Comments   
Comment by Otto Kekäläinen [ 2020-07-08 ]

Which version are you running? What does `dpkg -l | grep mariadb` show?

You could try uninstalling and purging and re-installing. Most likely you have some manual changes in /etc/mysql that causes this. You can also review yourself what `find /etc/mysql -ls` shows.

Comment by Oleksandr Marushchenko [ 2020-07-08 ]
  1. dpkg -l | grep mariadb
    ii mariadb-client-10.3 1:10.3.22-1ubuntu1 amd64 MariaDB database client binaries
    ii mariadb-client-core-10.3 1:10.3.22-1ubuntu1 amd64 MariaDB database core client binaries
    ii mariadb-common 1:10.3.22-1ubuntu1 all MariaDB common metapackage
    ii mariadb-server 1:10.3.22-1ubuntu1 all MariaDB database server (metapackage depending on the latest version)
    ii mariadb-server-10.3 1:10.3.22-1ubuntu1 amd64 MariaDB database server binaries
    ii mariadb-server-core-10.3 1:10.3.22-1ubuntu1 amd64 MariaDB database core server files

Ubuntu 20.04 LTS (GNU/Linux 5.4.0-37-generic x86_64)

  1. find /etc/mysql -ls
    258476 4 drwxr-xr-x 4 root root 4096 Jun 8 12:45 /etc/mysql
    258495 4 drwxr-xr-x 2 root root 4096 Jun 1 12:34 /etc/mysql/mariadb.conf.d
    258621 4 rw-rr- 1 root root 336 Dec 11 2019 /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf
    258620 4 rw-rr- 1 root root 733 Jan 5 2020 /etc/mysql/mariadb.conf.d/50-client.cnf
    258776 4 rw-rr- 1 root root 4007 Jun 8 12:46 /etc/mysql/mariadb.conf.d/50-server.cnf
    258775 4 rw-rr- 1 root root 1032 Jan 5 2020 /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
    258316 4 rw-rr- 1 root root 870 Jun 8 12:46 /etc/mysql/my.cnf
    258494 4 -rwxrwxrwx 1 root root 869 Jun 8 12:44 /etc/mysql/mariadb.cnf
    258466 4 rw------ 1 root root 261 Jun 1 12:34 /etc/mysql/debian.cnf
    258457 0 lrwxrwxrwx 1 root root 24 Jun 1 12:34 /etc/mysql/my-alt.cnf -> /etc/alternatives/my.cnf
    258774 4 -rwxr-xr-x 1 root root 1620 Jan 5 2020 /etc/mysql/debian-start
    258477 4 drwxr-xr-x 2 root root 4096 Jun 1 12:34 /etc/mysql/conf.d
    258478 4 rw-rr- 1 root root 8 Jun 8 12:42 /etc/mysql/conf.d/mysql.cnf
    258479 4 rw-rr- 1 root root 55 Aug 3 2016 /etc/mysql/conf.d/mysqldump.cnf
    258480 4 rw-rr- 1 root root 839 Aug 3 2016 /etc/mysql/my.cnf.fallback
  1. history
    1 apt-get update
    2 …
    3 apt-get update
    4 apt-get upgrade
    5 apt install mariadb-server
    6 …
    7 …
    8 mysql_secure_installation
    9 service mariadb restart

It was absolutely clean install from fresh Ubuntu in DigitalOcean. I found how to fix it - i was need to remove the /etc/mysql/my.cnf link and create the real file instead, but the default setup is broken - you cant change anything in config because of World-writable config. It can be the maintainer problem - i just didn't found where to make report to them.

Comment by Otto Kekäläinen [ 2020-07-08 ]

This is surely does not look like a clean install. A clean install
would not create the file: /etc/mysql/my-alt.cnf ->
/etc/alternatives/my.cnf

Somebody or something created that file and it is the root cause to
this issue. The file should be called my.cnf and not my-alt.cnf.

Comment by Faustin Lammler [ 2021-03-10 ]

wokenlex can you confirm and can we close this issue then?

Comment by Oleksandr Marushchenko [ 2021-03-10 ]

I didn't tried it after that. It's look like it was issue with mysql_secure_installation, what was runned as root. I think you can close, because it's not directly related to mariadb.

Generated at Thu Feb 08 09:17:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.