网站环境升级,由于dedecms版本中php5.4中经常中文白页,只有选择低版本的lampp,决定使用lampp1.7.7,解压缩后在启动lampp时提示mysql无法启动。

查看/opt/lampp/var/mysql/www.centos.error文件,报错内容如下:

141109 11:10:19 mysqld_safe Starting mysqld daemon with databases from /opt/lamp

p/var/mysql

141109 11:10:19 [Note] Plugin 'FEDERATED' is disabled.

/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)

141109 11:10:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgr

ade to create it.

InnoDB: The InnoDB memory heap is disabled

InnoDB: Mutexes and rw_locks use InnoDB's own implementation

InnoDB: Compressed tables use zlib 1.2.3

141109 11:10:19  InnoDB: Initializing buffer pool, size = 16.0M

141109 11:10:19  InnoDB: Completed initialization of buffer pool

141109 11:10:19  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 /opt/lampp/var/mysql/ibdata1

InnoDB: File operation call: 'create'.

InnoDB: Cannot continue operation.

141109 11:10:19 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/www.centos

.pid ended

根据提示,在Plugin和mysqld_safe上研究了半天也没有结果,只好尝试检查一下权限的问题

[root@www bin]# ll /opt/lampp/var/mysql

总用量 28

drwx------ 2 root   root 4096 11月  9 11:10 cdcol

drwx------ 2 root   root 4096 11月  9 11:10 mysql

-rw-r--r-- 1 root   root    5 11月  9 11:10 mysql_upgrade_info

drwx------ 2 root   root 4096 11月  9 11:10 performance_schema

drwx------ 2 root   root 4096 11月  9 11:10 phpmyadmin

drwx------ 2 root   root 4096 11月  9 11:10 test

-rw-rw---- 1 nobody root  974 11月  9 11:10 www.centos.err

看到了吗?mysql工作目录的权限跟mysql创建的文件的权限不一致,修改目录权限为nobody.root试试

[root@www bin]# chown -R nobody.root /opt/lampp/var/mysql

[root@www bin]# /opt/lampp/lampp startmysql

XAMPP: Starting MySQL...

[root@www bin]# 

终于启动成功了。