发布于 2014-12-06 08:54:14 | 5137 次阅读 | 评论: 1 | 来源: PHPERZ
Mysql关系型数据库管理系统
MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司。MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。
本文为大家讲解的是mysql报错:Error writing file '/var/run/mysqld/mysqld.pid'问题的解决方法,感兴趣的同学参考下。
错误描述:
[ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28)
130830 10:59:02 InnoDB: Initializing buffer pool, size = 1.0G
130830 10:59:02 InnoDB: Completed initialization of buffer pool
130830 10:59:02 InnoDB: Started; log sequence number 0 2727887496
130830 10:59:02 [ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28)
130830 10:59:02 [ERROR] Can't start server: can't create PID file: No space left on device
130830 10:59:02 mysqld_safe Number of processes running now: 0
130830 10:59:02 mysqld_safe mysqld restarted
130830 10:59:02 InnoDB: Initializing buffer pool, size = 1.0G
130830 10:59:02 InnoDB: Completed initialization of buffer pool
130830 10:59:02 InnoDB: Started; log sequence number 0 2727887496
130830 10:59:02 [ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28)
130830 10:59:02 [ERROR] Can't start server: can't create PID file: No space left on device
130830 10:59:03 mysqld_safe Number of processes running now: 0
130830 10:59:03 mysqld_safe mysqld restarted
130830 10:59:03 InnoDB: Initializing buffer pool, size = 1.0G
错误原因:
不能写入默认的pid文件,就 修改 /etc/init.d/mysqld,把pid指向别的路经
[root@app60 mysqld]# vi /etc/init.d/mysqld
.....
get_mysql_option mysqld datadir "/var/lib/mysql"
datadir="$result"
get_mysql_option mysqld socket "$datadir/mysql.sock"
socketfile="$result"
get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
errlogfile="$result"
get_mysql_option mysqld_safe pid-file "/opt/mysqldata/mysqld.pid" # '/var/run/mysqld/mysqld.pid' 原始值,这里修改成别的路径/opt/mysqldata/mysqld.pid
mypidfile="$result"
.....
然后启动mysqld服务,OK,成功了。