mysql在nfs上安装的问题

来源:互联网 发布:知用电子 编辑:程序博客网 时间:2024/05/16 14:59

#/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql/ --user=mysql --pid-file=/usr/local/mysql/data/huangshan.pid --skip-locking --port=3306 &
[1] 30596
[root@tianshan local]# InnoDB: Unable to lock ./ibdata1, error: 37
100810 13:48:30  InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37
InnoDB: Unable to lock ./ibdata1, error: 37

解决办法:

InnoDB: Unable to lock ./ibdata1, error: 37

I recently faced the “error  InnoDB: Unable to lock ./ibdata1, error: 37 “ while moving my data directory to NFS from local disk , when I restarted the mysql , the restart failed and I got the error in the error log , all permissions were set properly so I was not sure whats going wrong , I was sure that there is some problem with the OS not able to lock the file and it was related to NFS so I

1) /etc/init.d/portmap restart
2) /etc/init.d/nfslock restart

Restarted the mysql and it worked .