Due to the problem cited in the title, I have wrote a script which :
sudo myscript.sh →
1°) Stop the mysql server
2°) Remove the current mariadb software ( zypper rm everything )
3°) Remove every files left
4°) Install mariadb software
5°) Start the mysql server ( systemctl start mysql.service; a database is created. )
exit
Now as normal user :
ls -l /etc/my.cnf
-rw-r----- 1 root mysql 3367 13. Feb 13:27 /etc/my.cnf
user_install@linux-dpgm:~> systemctl start mysql
You need to run systemctl as root.
user_install@linux-dpgm:~> mysql -u root
mysql: Can't read dir of '/etc/my.cnf.d' (Errcode: 13 "Permission denied")
Fatal error in defaults handling. Program aborted
user_install@linux-dpgm:~>
Well, it can’t access /etc/my.cnf.d/ because you ran the system daemon as unprivileged user.
The permissions of this directory are:
ls -ld /etc/my.cnf.d
drwxr-x--- 2 root mysql 160 13. Feb 13:26 /etc/my.cnf.d
Although, it does work fine here if I run “systemctl start mysql” as user (and enter the root password into the dialog that appears)…
What are the permissions for “/etc/my.cnf.d/” in your case?
Maybe try to disable AppArmor as a test?
This might block things if wrongly configured, which leads to strange “permission errors” even if things are run as root.
From what you posted,
You seem to be changing permissions on the mysql configuration file which won’t do anything at all.
Database apps in general including mysql/mariadb run in a service account security context which is completely separate from its own database users which again is completely different than system users.
So, in other words…
I don’t think anything you’ve done has anything to do with each other, much less the objective stated in your subject line.
First thing you should do is restore your mariadb install to its default configuration, completely.
Then you should run the mysql security script which among other things sets the mysqladmin password and whether you you can set up remote connections or not.
Then, if I understand your objective correctly, create a database
Then add an additional user other than the mysqladmin to access that database.
There are no “normal users” as I think you’re describing…
And, “normal users” shouldn’t have anything to do with system users.
Only non-admin database users which have to be created on a database by database basis that don’t have mysqladmin privileges which <might> have same credentials as system users.
Ok the problem comes from bad permission on /etc/my.cnf as you said.
Starting/Stoping whith sudo or not as normal user (not root ) make no difference as soon as the permission is set correctly.
With wrong permission ( mode 644 ) starting/stoping with systemctl in an admin konsole, and login to the mariadb server from normal user (not root) konsole make no difference : that give an error
mysql: Can't read dir of '/etc/my.cnf.d' (Errcode: 13 "Permission denied")Fatal error in defaults handling. Program aborted