Data Dir (Permission Denied)
Posted by: wagner marques
Date: September 20, 2023 06:40AM

Hi...


I'm trying to start mysql with datadir as a mounted partition but I'm facing permission denied problem and mysql does not starts.


My datadir is: /home/wgn/mnt/mysql8data/mysql

that is mounted as below:

/dev/sdb1 on /home/wgn/mnt/mysql8data type ext4 (rw,relatime,seclabel,errors=remount-ro)


And permissions of my data dir are:
[wgn@fedora ~]$ ls -ilha /home/wgn/mnt/
total 24K
4728662 drwxr-xr-x. 5 wgn wgn 4,0K set 19 15:34 .
4718593 drwx--x---+ 52 wgn wgn 4,0K set 19 23:26 ..
2 drwxrwxrwx. 30 wgn wgn 4,0K set 17 23:20 ext4
2 drwxrwxrwx. 4 mysql mysql 4,0K set 19 15:35 mysql8data
5128036 drwxr-xr-x. 2 wgn wgn 4,0K set 16 15:09 wgnbk


My selinux are in permissive mode:

wgn@fedora ~]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33


The mysql start process log are below

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.812522Z 0 [Warning] [MY-010091] [Server] Can't create test file /home/wgn/mnt/mysql8data/mysq/mysqld_tmp_file_case_insensitive_test.lower-test

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.812638Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 3636

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.817024Z 0 [Warning] [MY-010091] [Server] Can't create test file /home/wgn/mnt/mysql8data/mysq/mysqld_tmp_file_case_insensitive_test.lower-test

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.817036Z 0 [Warning
[MY-010159] [Server] Setting lower_case_table_names=2 because file system for /home/wgn/mnt/mysql8data/mysql/ is case insensitive

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.817095Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/home/wgn/mnt/mysql8data/mysql/' (OS errno: 13 - Permission denied)

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.817237Z 0 [ERROR] [MY-010119] [Server] Aborting

set 19 23:32:20 fedora mysqld[3636]: 2023-09-20T02:32:20.817517Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34) MySQL Community Server - GPL.

set 19 23:32:20 fedora systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE

set 19 23:32:20 fedora systemd[1]: mysqld.service: Failed with result 'exit-code'.

set 19 23:32:20 fedora systemd[1]: Failed to start mysqld.service - MySQL Server.

set 19 23:32:20 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mysqld comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

set 19 23:32:20 fedora systemd[1]: mysqld.service: Consumed 2.254s CPU time.

set 19 23:32:20 fedora sudo[3606]: pam_unix(sudo:session): session closed for user root

set 19 23:32:20 fedora audit[3606]: USER_END pid=3606 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
set 19 23:32:20 fedora audit[3606]: CRED_DISP pid=3606 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'



Could someone helps, please, what could be wrong to cause permission denied to prevent mysql to write in /home/wgn/mnt/mysql8data directory?

Best regards...

Options: ReplyQuote


Subject
Views
Written By
Posted
Data Dir (Permission Denied)
510
September 20, 2023 06:40AM
157
October 09, 2023 09:11PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.