On Thursday 23 June 2011 4:47 pm, Connie Sieh wrote:
> On Thu, 23 Jun 2011, Larry Linder wrote:
> > I have a need to move an installation of mysql from /var/lib/mysql to
> > another disk.  /var has limited size.
> > I installed a new 1 T disk on new system.
> > used "yum" to install mysql-server mysql it installs and runs
> > from /var/lib/mysql
> > /etc/init.d/mysqld  stop
> > I followed the procedure in RH to move the data files etc.
> > Once you change the my.cnf to new location
> >
> > /etc/init.d/mysqld start
> > long delay
> > (failed)
> > Not much of an error message.
> >
> >
> > The last time I use ln -s to link new disk to /var/lib/mysql.   When
> > system was rebuilt this went away and I need a reliable way to move mysql
> > to new disk.
> >
> > Thank You
> > Larry Linder
>
> Larry,
>
> Does this system have Selinux enabled?  If so does selinux like how you
> did the move.  I assume you mounted the new disk on /var/lib/mysql .
>
> There is a mysql log file in /var/log/mysql.log is there any entries
> from when you did the /etc/init.d/mysqld start .
>
> -connie sieh
The log files are good clue - 

The solution to problem was to turn off  selinux move and initialize new 
location.
If you have any existing Data make sure you back it up.

New location for mysql is 1 T drive /mcdb

/etc/init.d/mysqld stop
mkdir /mcdb/mysql                                               # make new 
direcotory
cp -R  /var/lib/mysql/*   /mcdb/mysql                   # copy recursively 
mysql files
chown mysql:mysql /mcdb/mysql                   # changes owner to mysql
vi /etc/my.cnf
Change datadir=/mcdb/mysql                              # changes path to mysql 
data

echo 0 >/selinux/enforce
/etc/init.d/mysql start                                         #starts from 
new location
echo 1 >/selinux/enforce                                        

Run python apps and it all works!  in a few minutes.

Incredibly simple and logical  -  Just not thinking about selinux and how it 
works.  Will have to give it more study.

Thank You
Larry Linder

Reply via email to