Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How to change MYSQL database directory to another directory


    I Installed mysql on my CentOS 6.2 Server. But when I tried to change the location of /var/lib/mysql to another directory. I can't start the mysql. Below is what I've done

    yum install mysql mysql-server mysql-devel
    mkdir /path/to/new/
    cp -R /var/lib/mysql /path/to/new
    chown -R mysql.mysql /path/to/new
    vi /etc/my.cnf
    change datadir=/var/lib/mysql to

    service mysqld start
    MySQL Daemon failed to start.
    Starting mysqld:                                           [FAILED]
    Did I miss something? Can anyone please help me on this, I'm a newbie in this field.

    Thank you

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Hi there,

    You might get some useful information from the MySql logs in /var/log/mysql*. If there's anything that looks interesting then post it and we might be able to help you out.

    Let us know how you get on.
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  3. #3
    Hi There,

    Thanks for the reply. I got it working. Seems that the problem is on selinux. I just switch it from disabled to permissive and It works.

    Thank you

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts