Users Online

We have 148 guests online
MySQL Data Path PDF Print E-mail
Written by Zack MIlls   
Wednesday, 09 September 2009 12:47

Changing the MySQL Data Path

 

 1) Take down the server.

2) Edit the my.cnf configuration file, typically located in /etc.  3) Add the following to the [mysqld] section:  datadir=/var/db/mysql
 
 
In fact, one has to change the ownership and mode. But the method to use a my.cnf in /etc still does not work. If you try to start mysql you get the following error message:  qwertzuiop# /usr/local/etc/rc.d/mysql-server.sh start  mysqldqwertzuiop# touch: /var/db/mysql/qwertzuiop.err: No such file or directory chown: /var/db/mysql/qwertzuiop.err: No such file or directory /usr/local/bin/mysqld_safe: cannot create /var/db/mysql/qwertzuiop.err: 
directory nonexistent 
 
 
 
    su     # stop mysqld     mv /var/db/mysql /big/mysql     ln -s /big/mysql /var/db/mysql 
    # start mysqld