Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    2,175

    mysql.server setting

    Running CentOS 4.6. Currently, the my.cnf contains:

    Code:
    [mysql.server]
    user=mysql
    basedir=/var/lib
    If I moved all files and directories under /var/lib/mysql/ to /harddisk3/mysql/ what do I enter for the basedir path?

  2. #2
    basedir=/harddisk3/mysql/

  3. #3
    Join Date
    Jan 2005
    Posts
    2,175
    Hmmm, but the original setting before I moved was /var/lib
    1 directory under, shouldn't it be /harddisk3 instead?

  4. #4
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    Try changing basedir to datadir:

    [mysqld]
    datadir=/harddisk3/mysql/


    That directory should contain all of your MySQL databases, then restart MySQL.
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

  5. #5
    After you moved /var/lib/mysql, what left in /var/lib?

  6. #6
    Join Date
    Mar 2008
    Posts
    58
    When you want to move mysql data dir to other partition, you not only change parth on my.cnf but also do something more.

    service mysql stop
    cp -R /var/lib/mysql/ /otherpartition/mysql
    chown -R mysql.mysql /otherpartition/mysql
    mv /var/lib/mysql/ /var/lib/mysql_old
    mkdir /var/lib/mysql
    chown mysql.mysql /var/lib/mysql
    ln -s /otherpartition/mysql/mysql.sock /var/lib/mysql/mysql.sock
    rm -rf /tmp/mysql.sock
    ln -s /otherpartition/mysql/mysql.sock /tmp/mysql.sock
    pico /etc/my.cnf
    edit
    [mysqld]
    datadir=/otherpartition/mysql/
    service mysql start

    If you have problem, paste here, someone will help you.

Posting Permissions

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