[MDEV-12048] my.cnf datadir config - cannot start database Created: 2017-02-11  Updated: 2017-02-19  Resolved: 2017-02-19

Status: Closed
Project: MariaDB Server
Component/s: Configuration
Affects Version/s: 5.5.52-galera
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Sanjay Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Centos 7



 Description   

Defined in the my.cnf
datadir=/data/local

170210 16:30:26 mysqld_safe Starting mysqld daemon with databases from /data/local
170210 16:30:26 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 6842 ...
170210 16:30:26 [Warning] Can't create test file /data/local/new-host-3.lower-test
170210 16:30:26 InnoDB: The InnoDB memory heap is disabled
170210 16:30:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170210 16:30:26 InnoDB: Compressed tables use zlib 1.2.7
170210 16:30:26 InnoDB: Using Linux native AIO
170210 16:30:26 InnoDB: Initializing buffer pool, size = 128.0M
170210 16:30:26 InnoDB: Completed initialization of buffer pool
170210 16:30:26 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
...



 Comments   
Comment by Elena Stepanova [ 2017-02-13 ]

The error says it's all:

 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.

What's your question?

Comment by Sanjay [ 2017-02-13 ]

The directory – datadir is owned by mysql user and the permissions are 777 tried 755 before but same errors, trying to move data to a non default directory.

moving the files back to /var/lib/mysql and removing the datadir parameter in my.cnf the database service starts.

My goal is to use datadir parameter and separate the data on an new filesystem

Comment by Elena Stepanova [ 2017-02-13 ]

It's CentOS, so please check your SELinux configuration. Try to disable SELinux (or set it to 'Permissive'), if the problem goes away, then it's the culprit.

Comment by Sanjay [ 2017-02-13 ]

Thanks much. Looks like search brings me same results for SElinux issue

Comment by Daniel Black [ 2017-02-16 ]

https://mariadb.com/kb/en/mariadb/what-to-do-if-mariadb-doesnt-start/ under "SELinux and MariaDB Path Changes" shows how to change the datadir and keep SElinux enabled.

Comment by Sanjay [ 2017-02-17 ]

Resolved , Please close the ticket.

CentOS 7, SELinux is on,
Also learned to mount the datadir on NFS
NFS should be mount with the context option

#/etc/fstab entry
server:/share/nfs/dir /data/mariadb nfs rw,tcp,nfsvers=4,rsize=32768,wsize=32768,intr,hard,nosharecache,context="system_u:object_r:mysqld_db_t:s0"

Comment by Daniel Black [ 2017-02-19 ]

Glad to hear it. Watch out for latency problems on NFS.

Generated at Thu Feb 08 07:54:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.