MySQL Forums
Forum List  »  Source, Builds, Binaries

Permission error when installing from .tar.gz
Posted by: Michael Kragh Pedersen
Date: September 12, 2016 04:07AM

I'm trying to install MySQL from a tar.gz file rather than from a package manager, as an experiment. I wish to change the datadir when I run install_db, so the command I'm using is:

/usr/local/mysql $ sudo scripts/mysql_install_db --user=mysql --datadir=/media/tmpuser/Data/MySQL/

But I get a permission error:
Installing MySQL system tables...
ERROR: 1 Can't create/write to file '/media/tmpuser/Data/MySQL/mysql/db.MYI' (Errcode: 13)
160912 11:29:24 [ERROR] Aborting

160912 11:29:24 [Note] ./bin/mysqld: Shutdown complete

However, a ls -l of both the Data and MySQL shows that I should have the correct permissions, owner and group set:
/media/tmpuser/Data $ ls -l
total 20
drwx------ 2 root root 16384 Sep 12 11:42 lost+found
drwxr-xr-x 4 mysql mysql 4096 Sep 12 11:55 MySQL

/media/tmpuser/Data/MySQL $ ls -l
total 16
drwx------ 2 mysql root 4096 Sep 12 11:55 mysql
-rw-rw---- 1 mysql mysql 126 Sep 12 11:55 mysql-bin.000001
-rw-rw---- 1 mysql mysql 19 Sep 12 11:55 mysql-bin.index
drwx------ 2 mysql root 4096 Sep 12 11:55 test

The new folders in the MySQL folder do get the root group assigned to them, but that is from running mysql_install_db, so it's not something I'm in control of.

There's no group option for mysql_install_db so I can't change the group that way. I've followed the instructions to the letter in the installation document that followed, so I am at a loss at what to do to get this to work. How do I fix this permissions issue?

Options: ReplyQuote


Subject
Views
Written By
Posted
Permission error when installing from .tar.gz
2202
September 12, 2016 04:07AM


Sorry, you can't reply to this topic. It has been closed.

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.