[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Disk Full Problem....

On Fri, Feb 20, 2004 at 01:41:09PM -0500, Srinivas Koppisetti wrote:
> Can we move mysql data files to a different volume and ask the endine to
> pick the data files from there. If so I need some more help on how to do
> that. 

I'm doing this off the top of my head so double-check my work before you
shoot yourself in the foot. I have not verified that mysql follows
symbolic links.  An alternative to using the symbolic link is to edit
/etc/rc.d/init.d/mysqld and change the datadir symbol, but you'll have
to be careful with every mysql update that your edited version of the
mysqld script doesn't get overwritten.

Assume your new disk is /u01 and you want to move the databases to

# /sbin/service mysqld shutdown
# du -sh /var/lib/mysql
        See how much space is used now.
# ls -ltR /var/lib/mysql
        Check file owners and permissions too
# mv /var/lib/mysql /u01/mysql
# du -sh /u01/mysql
# ls -ltR /u01/mysql
# ln -s /var/lib/mysql /u01/mysql
# ls -ltR /var/lib/mysql
        You should see the same files but in the new locations
# /sbin/service/mysqld start

Ed Wilts, Mounds View, MN, USA
mailto:ewilts ewilts org
Member #1, Red Hat Community Ambassador Program

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]