Moving MySQL directory on an Amazon EC2 machine

Posted by Traveling Tech Guy on Server Fault See other posts from Server Fault or by Traveling Tech Guy
Published on 2010-02-06T02:00:38Z Indexed on 2012/09/25 21:39 UTC
Read the original article Hit count: 406

Filed under:
|
|

I'm trying to have MySQL point to a directory on an EBS volume I mounted on my EC2 machine.
I took th following steps:

  1. Stopped MySQL (/etc/init.d/mysqld stop) - successful
  2. Created a MySQL directory on my volume, mounted on /vol (mkdir /vol/mysql)
  3. Copied the contents of /var/lib/mysql to /vol/mysql (cp -R /var/lib/mysql /vol/mysql)
  4. Chanded the owner and group of that directory to match the original (chown -R mysql:mysql /vol/mysql) - after this step, the 2 directories are identical.
  5. Edited the /etc/my.cnf file (commented 2 original lines):

[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
datadir=/vol/mysql
socket=/vol/mysql/mysql.sock`

  1. Started MySQL (/etc/init.d/mysqld start) - FAILED

The error file /var/log/mysqld.log contains the following lines:

100205 20:52:54 mysqld started
100205 20:52:54 InnoDB: Started; log sequence number 0 43665
100205 20:52:54 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.45' socket: '/vol/mysql/mysql.sock' port: 3306 Source distribution

No other errors are available.

  1. What am I doing wrong?
  2. Where can I find the error/s encountered by MySql?
  3. If I restore the original lines, MySQL starts, leading me to believe it may be a permissions issue - but permissions are the same for both directories?

Thanks!

© Server Fault or respective owner

Related posts about linux

Related posts about mysql