[MDEV-29417] Unable to create table with data directory Created: 2022-08-30  Updated: 2022-09-01  Resolved: 2022-09-01

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table
Affects Version/s: 10.5.16
Fix Version/s: N/A

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

Linux via Fedora 36



 Description   

This is right out of the MySQL documentation:

  • MariaDB [pets]> CREATE TABLE t1 (c1 INT PRIMARY KEY) DATA DIRECTORY = '/home/dch/ms';
  • ERROR 1005 (HY000): Can't create table `pets`.`t1` (errno: 168 "Unknown (generic) error from engine")

The external directory is owned my mysql.

I am working on a project and I really need this to work. In the interim, my project is halted.



 Comments   
Comment by Daniel Black [ 2022-08-30 ]

The systemd start of MariaDB, (and most system services) by default protects writing to /home directories.

This can be changed per:
https://mariadb.com/kb/en/systemd/#useful-systemd-options

Comment by David Cary Hart [ 2022-09-01 ]

Many thanks.

Indeed, it does work providing that the data directory is owned by mysql. What's particularly helpful is that a subdirectory is automatically created with the name of the database. I have a limited life project with 112 database dumps in .sql.

Not sure how to close this.

Comment by Daniel Black [ 2022-09-01 ]

Glad that worked for you.

Generated at Thu Feb 08 10:08:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.