Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use FreeBSD 8.2, mysql 5.1.58. I want change mysql default directory. I config datadir= /path OR my-data-dir= /path on my.cnf but not done. Note: i permission for /path is 755 and owner mysql:mysql. By another way, i set in /etc/rc.conf but not done

This is error, when restart mysql services.

usr/local/etc/rc.d/mysql-server restart mysql not running? (check /var/db/mysql/bsd1.abc.com.pid).

Help me.

share|improve this question
    
When you do this and restart mysql, are you getting errors - how are you working out it is not working? –  Paul Sep 22 '11 at 3:48

2 Answers 2

another way is:

move and 'ln -s' /var/db/mysql somewhere.

share|improve this answer

I assume your current MySQL data directory is the default /var/db/mysql.

  1. Stop MySQL (service mysql-server stop)
  2. Change the datadir in rc.conf (mysql_dbdir="/another/directory")
  3. mv /var/db/mysql /another/directory
  4. Start MySQL again (service mysql-server start)

If there are still problems, ensure that the directory itself and all directories inside belong to user and group mysql. (chown -R mysql:mysql /another/directory; chmod 600 /another/directory)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.