LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-10-2016, 08:51 AM   #1
airtonjal
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Rep: Reputation: Disabled
Permission issue in Centos 7


Hi,

I need to change the MariaDB datadir in Centos 7. The default execution works fine, but when I set the datadir property inside /etc/my.cnf I cannot start the process:

Code:
[mariadb@localhost ~]$ sudo systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[mariadb@localhost ~]$ sudo journalctl -xe
Mar 10 10:35:55 localhost.localdomain mysqld[41857]: 2016-03-10 10:35:55 [ERROR] mysqld: Can't create/write to file '/home/mariadb/tmp/ibpGvyL9'
(Errcode: 13 "Permission denied")
permissions seems ok:

Code:
[mariadb@localhost ~]$ ls -lsa
0 drwx------  4 mariadb mariadb 148 Mar 10 10:27 .
0 drwxr-xr-x. 5 root    root     60 Mar 10 10:11 ..
0 drwxr-xr-x  2 mysql   mysql    10 Mar 10 10:23 data
0 drwxr-xr-x  2 mysql   mysql    10 Mar 10 10:27 tmp
Also, selinux is disabled:

Code:
[mariadb@localhost ~]$ getenforce
Disabled
[mariadb@localhost ~]$ sestatus
SELinux status:                 disabled
Here's an output for the disk space used:

Code:
[mariadb@localhost ~]$ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   50G  1.9G   49G   4% /
devtmpfs                  65G     0   65G   0% /dev
tmpfs                     65G     0   65G   0% /dev/shm
tmpfs                     65G  8.9M   65G   1% /run
tmpfs                     65G     0   65G   0% /sys/fs/cgroup
/dev/sda2                497M  170M  327M  35% /boot
/dev/mapper/centos-home  9.1T  6.4G  9.1T   1% /home
tmpfs                     13G     0   13G   0% /run/user/0
Any ideas what might be causing the permission issue??

Thanks in advance
 
Old 03-10-2016, 09:20 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi,

Quote:
Originally Posted by airtonjal View Post
permissions seems ok:

Code:
[mariadb@localhost ~]$ ls -lsa
0 drwx------  4 mariadb mariadb 148 Mar 10 10:27 .
0 drwxr-xr-x. 5 root    root     60 Mar 10 10:11 ..
0 drwxr-xr-x  2 mysql   mysql    10 Mar 10 10:23 data
0 drwxr-xr-x  2 mysql   mysql    10 Mar 10 10:27 tmp
Which user is running the database server - mysql (default) or mariadb? Assuming the listing above is for /home/mariadb, they look wrong to me. The mariadb user doesn't have access to "tmp", while the mysql user doesn't have access to ".".
 
Old 03-10-2016, 10:44 AM   #3
airtonjal
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi cliffordw, thanks for the help.

I'm running with mariadb user, you are right that is /home/mariadb dir. I tried setting the owner and group both to mariadb (chown mariadb:mariadb) but it didn't work.

Elaborating a little more, whenever I set datadir, tmpdir and log_error in /etc/my.cnf I get a permission error, regardless of permission/group. I even tried with root user and some other directory options, but all of them hits the same error.

Any other ideas??

Thanks
 
Old 03-10-2016, 10:58 AM   #4
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi,

Have you tried changing the owner of "data" and "tmp" to mariadb?
 
Old 03-10-2016, 11:05 AM   #5
airtonjal
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hey cliffordw,

yes I did, same error :/
 
Old 03-10-2016, 02:52 PM   #6
airtonjal
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Found the issue, it was mysql related, thanks anyway!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] centos file permission issue yerunkar11 Linux - Newbie 2 05-15-2015 07:00 AM
[SOLVED] Permission issues in CentOS malak33 Linux - Newbie 6 05-04-2012 02:07 AM
[SOLVED] CentOS file Permission BernardLinux Linux - Newbie 2 09-11-2011 11:26 PM
Booting Centos 5.4 Issue: "CentOS CD Not found in any of the media drives. Please i g.navink Red Hat 1 04-07-2010 04:12 PM
Permission issue??? ThunderStrick Linux - Newbie 4 07-06-2009 11:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration