MySQL Forums
Forum List  »  Newbie

Can't move the database directory
Posted by: Stuart Bury
Date: June 19, 2009 08:15AM

Okay, I've installed (and reinstalled) MySQL, and I can't for the LIFE of me convince it that storing its database files in a directory other than /var/bin/mysql is a reasonable thing to ask.

I've set file permissions. I've set file ownership. I've created symbolic links. I've edited the my.cnf files - yes, both of them. Bottom line, MySQL refuses point-blank to store databases anywhere but the default location. Any attempt to convince it otherwise results in this output:

infinity@underling:~$ mysqld
090619 15:06:50 [Warning] Can't create test file /home/infinity/testdb/underling.lower-test
090619 15:06:50 [Warning] Can't create test file /home/infinity/testdb/underling.lower-test
090619 15:06:50 [Warning] One can only use the --user switch if running as root

090619 15:06:50 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.


Running mysqld_safe doesn't help either. It looks okay to begin with...

infinity@underling:~$ mysqld_safe
nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /home/infinity/testdb
mysqld_safe[4220]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[4230]: ended


...but then it just isn't accessible:

infinity@underling:~$ mysqladmin -h localhost --password=xxxx version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!


So...can anyone tell me what's going on before I give up and go back to Windows and M$ SQL Server?

Options: ReplyQuote


Subject
Written By
Posted
Can't move the database directory
June 19, 2009 08:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.