1

trying to setup new server here but keep getting this in error log:

mysqld_safe Starting mysqld daemon with databases from /data/mysql/myisam
[Warning] Can't create test file /data/mysql/myisam/hostname.lower-test
[Warning] Can't create test file /data/mysql/myisam/hostname.lower-test
[Note] Flashcache bypass: disabled
[Note] Flashcache setup error is : setmntent failed

/usr/sbin/mysqld: File '/var/mysql/bin/bin-log.index' not found (Errcode: 13)
[ERROR] Aborting

[Note] /usr/sbin/mysqld: Shutdown complete

mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

everything under /data/mysql (it's ibdata and myisam folders) is owned my mysql:mysql and has proper permissions

same goes for folders with bin and relay logs under /var/mysql

apparmor is purged from server

any ideas?

PS

it seems like something else apart from apparmor is affecting permissions to access mysql files

after i changed data directory to more default one - /var/lib/mysql and "Can't create test file" error is gone, but "'/var/mysql/bin/bin-log.index' not found (Errcode: 13)" is still there

PPS

so i installed apparmor back and added all folders to mysqld's profile and errors mentioned above are now gone(or mysql doesn't even get to that point now)

what i have now is this: /usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

banging my head against the wall.

5
  • 1
    I just want to confirm the permisison ls -l /var/mysql/bin?
    – quanta
    Aug 8, 2011 at 16:40
  • it's empty folder rwxr-x--- mysql:mysql
    – keymone
    Aug 8, 2011 at 17:57
  • Is mysqld actually running as the mysql user? Aug 8, 2011 at 18:01
  • well i tend to think so because that's the user in my.cnf
    – keymone
    Aug 8, 2011 at 18:25
  • Here's a shot in the dark - did you download the right architecture (32/64bit)? I've had 'file not found' errors before due to downloading the wrong installation.
    – sreimer
    Aug 9, 2011 at 21:29

3 Answers 3

4

This question is a bit old now, but in case other people come across this page (like I did), here is what got me working:

In my case the answer was apparmor.

The solution: edit the file /etc/apparmor.d/usr.sbin.mysqld

Add the following lines:

/path/to/new/data/ r,
/path/to/new/data/** rwk,
/path/to/new/logs/ r,
/path/to/new/logs/ rw,

Then restart apparmor:

sudo /etc/init.d/apparmor restart

AppArmor is preventing mysql from accessing the new locations for these files. This is why the permissions all look correct. It is correct that "something" is preventing mysql from accessing the new locations. That "something" is "apparmor" :-)

Apparmor seems to be standard on Ubuntu 11.10, which is where I had this problem. 10.04 does not seem to have Apparmor installed by default.

Hope this helps someone, I've been tearing my hair out over this one for too many hours!

0

If this is a brand new install, you need to run the mysql_install_db script to create the needed tables/files.

1
  • i tried - it gives me same error
    – keymone
    Aug 8, 2011 at 17:57
0

Is it a fresh install?

bin-log.index is an index file for binary log file names. As a temporary workaround, you can comment the log-bin= line in my.cnf and try again.

If it doesn't help, try to start MySQL with mysqld_safe --user=root &, login to MySQL and run the following commands:

mysql> FLUSH LOGS;
mysql> RESET MASTER;

And start MySQL again:

sudo killall mysqld_safe
sudo /etc/init.d/mysqld start
1
  • problem is that something prevents mysql process from accessing those files. i will update my question again as i found some more details
    – keymone
    Aug 9, 2011 at 8:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .