DevHeads.net

Install Mariadb on Centos 7 fails

Folks

I'm having problems installing Mariadb in Centos 7.

Here's what I did:

0) Become root
1) Make sure that mariadb and mysql are NOT installed.
2) Delete residual libs
rm -rf /var/lib/mysq*
3) yum install -y mariadb-server
installed mariadb-5.5.50-1.el7_2.x86_64 from the Centos
'updates' repository
4) systemctl start mariadb
5) systemctl status mariadb

All works well until step 5, where I get the result:

# systemctl status mariadb
? mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled;
vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-09-22 17:46:38
PDT; 4min 3s ago
Main PID: 16261 (code=exited, status=1/FAILURE)

Sep 22 17:46:37 goat.xxx.com mysqld_safe[16261]:
/usr/bin/mysqld_safe: line 139: /var/log/mysqld.log: Permission denied
Sep 22 17:46:37 goat.xxx.com mysqld_safe[16261]:
/usr/bin/mysqld_safe: line 183: /var/log/mysqld.log: Permission denied
Sep 22 17:46:37 goat.xxx.com mysqld_safe[16261]: touch: cannot touch
`/var/log/mysqld.log': Permission denied
Sep 22 17:46:37 goat.xxx.com mysqld_safe[16261]: chown: cannot access
`/var/log/mysqld.log': No such file or directory
Sep 22 17:46:37 goat.xxx.com mysqld_safe[16261]: chmod: cannot access
`/var/log/mysqld.log': No such file or directory
Sep 22 17:46:37 goat.xxx.com systemd[1]: mariadb.service: main
process exited, code=exited, status=1/FAILURE
Sep 22 17:46:38 goat.xxx.com systemd[1]: mariadb.service: control
process exited, code=exited status=1
Sep 22 17:46:38 goat.xxx.com systemd[1]: Failed to start MariaDB
database server.
Sep 22 17:46:38 goat.xxx.com systemd[1]: Unit mariadb.service entered
failed state.
Sep 22 17:46:38 goat.xxx.com systemd[1]: mariadb.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@goat ~]#

My environment is a Centos 7 installation running as a VM inside
Vmware, and is not a production system. It is updated nightly.

When I examined the files alluded to,

/var/log/mysqld.log
does not exist
but
/var/log/mariadb/mariadb.log
exists and is empty.

Adivce would be appreciated

Thanks

David

Comments

Re: Install Mariadb on Centos 7 fails

By cpolish at 09/23/2016 - 11:36

On 2016-09-22 18:07, david wrote:
Hi David,

What do these commands show?

ls -lF /var/log/mysqld.log
ls -lZ /var/log/mysqld.log
getenforce

Best regards,

Re: Install Mariadb on Centos 7 fails

By David at 09/23/2016 - 12:16

At 09:36 AM 9/23/2016, you wrote:

Charles
As the original note pointed out, /var/log/mysqld.log does not exist,
as shown by these two commands:

[root@goat ~]# ls -1F /var/log/mysqld.log
ls: cannot access /var/log/mysqld.log: No such file or directory
[root@goat ~]# ls -1Z /var/log/mysqld.log
ls: cannot access /var/log/mysqld.log: No such file or directory
[root@goat ~]#

HOWEVER, /var/log/mariadb/mariadb.log does exist and is empty
[root@goat ~]# ls -l /var/log/mariadb/*
-rw-r----- 1 mysql mysql 0 Sep 23 10:08 /var/log/mariadb/mariadb.log

David

Re: Install Mariadb on Centos 7 fails

By Warren Young at 09/23/2016 - 12:03

On Sep 23, 2016, at 10:36 AM, <a href="mailto: ... at surewest dot net"> ... at surewest dot net</a> wrote:
Simply saying 'sudo restorecon -R /var/log’ may fix it by resetting SELinux file permissions to their intended defaults.

That won’t help if you have explicit SELinux labels applied to that one log file, though. The ls -lZ output (from after the restorecon command) would be necessary to understand the complaint from mysqld_safe in that case.

Re: Install Mariadb on Centos 7 fails

By Tony Schreiner at 09/23/2016 - 08:37

Is your /etc/my.cnf left over from before, is there anything about the
location of the log file?