Thanks for getting back.
I did not change ownerships when I moved files.
I made a separate data directory mysqldata inside basedir as you suggested.
As of now both these are owned by mysql because I wasn't sure which files exactly belong to datadir and which don't. I have moved following files to data directory:
ib_arch_log_0000000000 ibdata1 ib_logfile0 ib_logfile1 linux.err
and following are still in the basedir:
mysqld.log mysqld.log-20050118.gz mysqld.log-20050119.gz mysqld.log-20050120.gz
mysql(dir)
The file permissions are as follows:
drwxr-xr-x 7 mysql root 352 2005-03-07 14:26 .
drwxr-xr-x 13 root root 352 2005-02-23 04:11 ..
drwx------ 2 mysql mysql 48 2005-01-21 16:19 m
drwxr-xr-x 2 mysql mysql 2360 2005-01-21 01:22 maxd
drwxr-xr-x 2 mysql root 528 2005-01-19 16:28 mysql
drwxr-xr-x 2 mysql root 208 2005-03-07 13:48 mysqldata
-rw-r----- 1 mysql mysql 7115 2005-03-06 02:54 mysqld.log
-rw-r--r-- 1 mysql root 384 2005-01-19 16:18 mysqld.log-20050118.gz
-rw-r--r-- 1 mysql root 598 2005-01-19 16:18 mysqld.log-20050119.gz
-rw-r--r-- 1 mysql root 592 2005-01-20 04:15 mysqld.log-20050120.gz
Now, I tried following:
mysqld_safe --basedir=/data/mysql --datadir=/data/mysql/mysqldata --user=mysql &
and I still get following error:
Starting mysqld-max daemon with databases from /data/mysql/mysqldata
/usr/bin/mysqld_safe: line 307: /data/mysql/mysqldata/linux.err: Permission denied
/usr/bin/mysqld_safe: line 313: /data/mysql/mysqldata/linux.err: Permission denied
STOPPING server from pid file /data/mysql/mysqldata/linux.pid
tee: /data/mysql/mysqldata/linux.err: Permission denied
050307 14:29:50 mysqld ended
tee: /data/mysql/mysqldata/linux.err: Permission denied
And it doesn't write anything in the mysqld.log file in the /data/mysql dir.
----Original Message Follows---- From: Michael Stassen <[EMAIL PROTECTED]> To: kaustubh shinde <[EMAIL PROTECTED]> CC: mysql@lists.mysql.com Subject: Re: permission denied error Date: Sun, 06 Mar 2005 13:16:45 -0500
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]
_________________________________________________________________
Screensavers unlimited! http://www.msn.co.in/Download/screensaver/ Download now!
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]