Usually, datadir is a subdirectory of basedir.  Something like

 mysqld_safe --basedir=/data/mysql --datadir=/data/mysql/data --user=mysql &

Are you certain you want your databases in your basedir, rather than in a subdirectory?

The errors you are getting seem to indicate that user mysql cannot write to your datadir (/data/mysql). Wherever you put your datadir, it must be writeable by mysql, not just owned by mysql. Usually, basedir is not writeable by mysql, only datadir is (and that's a good idea, security-wise). Furthermore, all the contents of datadir must be writeable by mysql. Did you preserve the datafiles' ownership when you moved them?

The usual setup would be to have basedir owned and writeable only by root, with datadir as a subdirectory owned and writeable by mysql.

If this doesn't get you going, send us the output of `ls -aFl /data/mysql`.

Michael

kaustubh shinde wrote:

Hi,
I have moved my base and data directories at /data/mysql on my system and /data/mysql is owned by user mysql. Earlier these were located at /var/lib/mysql
my /etc/my.cnf has following entries:


# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
myisam_sort_buffer_size = 8M

set-variable = datadir=/data/mysql/
set-variable = bdb_home=/data/mysql/
set-variable = basrdir=/data/mysql/

When I try to start mysql using
mysqld_safe & I get following error:
Starting mysqld-max daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: line 307: /var/lib/mysql/linux.err: Permission denied
/usr/bin/mysqld_safe: line 313: /var/lib/mysql/linux.err: Permission denied
STOPPING server from pid file /var/lib/mysql/linux.pid
tee: /var/lib/mysql/linux.err: Permission denied
050306 03:33:03  mysqld ended
tee: /var/lib/mysql/linux.err: Permission denied

I tried using mysqld_safe --basedir=/data/mysql --datadir=/data/mysql --user=mysql &
Then I get error
Starting mysqld-max daemon with databases from /data/mysql
/usr/bin/mysqld_safe: line 307: /data/mysql/linux.err: Permission denied
/usr/bin/mysqld_safe: line 313: /data/mysql/linux.err: Permission denied
STOPPING server from pid file /data/mysql/linux.pid
tee: /data/mysql/linux.err: Permission denied
050306 03:08:03 mysqld ended
tee: /data/mysql/linux.err: Permission denied


It used to work fine when I had /var/lib/mysql folder still there. The data was getting written at /data/mysql. But when I moved the /var/lib/mysql folder to some other directory the problem started.
I have suse 9.2. I am frustrated trying different things and I read all I could regarding this but dont seem to point out exact problem.
I really need to get this thing done and I would really appreciate any ideas or direction.
Thanks
Kaustubh


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to