Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 \
 --tmpdir=/tools/mysql/mysql/tmp

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.