Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OS : Redhat

I try to launch the mysql database after a fresh installation. The problem is I am not root on this server and my user have not the permission to write in the /var/lib folder.

When I try to launch the mysqld, I have passed lot of options to mysqld_safe command line but mysqld always need to write in the /var/lib folder :/

Command line :

bin/mysqld_safe --basedir=/tools/mysql/mysql --log-error=/tools/mysql/mysql/log \
--datadir=/tools/mysql/mysql/data --defaults-file=/tools/mysql/mysql/my.cnf \

error log :

130918 16:43:23 mysqld_safe Logging to '/tools/mysql/mysql/log.err'.
mkdir: cannot create directory `/var/lib/mysql': Permission denied
chown: invalid user: `mysql'
chmod: cannot access `/var/lib/mysql': No such file or directory*
130918 16:43:23 mysqld_safe Starting mysqld daemon with databases from /tools/mysql/mysql/data
130918 16:43:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Anyone know how can I ask to mysqld to do not write in the /var/lib directory ?

share|improve this question
Invalid user: mysql does not sound good. This rather looks like the mysql-user does not exist. How was mysql installed on that server? – Nils Sep 18 '13 at 21:05
up vote 1 down vote accepted

It's probably the Unix socket, which defaults to /var/lib/mysql/mysql.sock. Try adding --socket=/tools/mysql/mysql/mysql.sock (or wherever you want to put it). You'll need to use the same option with the client.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.