centos搭建PHP的常见问题汇总

来源:互联网 发布:电脑桌面日程软件 编辑:程序博客网 时间:2024/05/21 17:48

问题1

Transaction Check Error: file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package mysql-community-common-5.6.25-2.el6.x86_64 file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package mysql-community-common-5.6.25-2.el6.x86_64 file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.73-5.el6_6.x86_64 conflicts with file from package mysql-community-common-5.6.25-2.el6.x86_64

解决:
上面问题提示是包冲突,只要删除相应的包即可
yum -y remove mysql-libs-5.1.52* “`
-y的意思就是不用询问是否remove
其他冲突同样操作卸载。

问题2

启动httpd时 service httpd start报错!

Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80no listening sockets available, shutting downUnable to open logs

解决:
该问题提是端口被占用,先 netstat -nlp |grep :80 查看一下是什么进程占用了80端口,
例如我机子上返回如下:

[root@VM_centos ~]# netstat -nlp |grep :80   tcp            0          0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1262/nginx

只要kill相应进程就0k kill -9 1262 或者直接狠点 killall -9 nginx !^_^

问题3:
启动MySQL时失败!!!
[root@VM_centos ~]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

查看mysqld.log日志文件一堆问题(崩溃。。。)

150924 16:02:58 [ERROR] Plugin 'InnoDB' init function returned error.                                       62 150924 16:02:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.                            63 150924 16:02:58 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist         64 150924 16:02:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended                           65 150924 16:38:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql                       66 150924 16:38:57  InnoDB: Initializing buffer pool, size = 8.0M                                              67 150924 16:38:57  InnoDB: Completed initialization of buffer pool                                            68 InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes                                 69 InnoDB: than specified in the .cnf file 0 5242880 bytes!                                                    70 150924 16:38:57 [ERROR] Plugin 'InnoDB' init function returned error.                                       71 150924 16:38:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.                            72 150924 16:38:57 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 73 150924 16:38:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended                           74 150924 17:09:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql                       75 150924 17:09:23  InnoDB: Initializing buffer pool, size = 8.0M                                              76 150924 17:09:23  InnoDB: Completed initialization of buffer pool                                            77 InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes                                 78 InnoDB: than specified in the .cnf file 0 5242880 bytes!                                                    79 150924 17:09:23 [ERROR] Plugin 'InnoDB' init function returned error.                                       80 150924 17:09:23 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.                            81 150924 17:09:23 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

解决:
运行 mysql_install_db –user=mysql
再启动 service mysqld start

[root@VM_centos ~]# service mysqld start
Starting mysqld: [ OK ]

这个原理具体也不知道为什么,网上查询的时候很多都出现相同问题,但是日志文件里error 都不一样,不多基本都提到了mysql_install_db –user=mysql 。我就直接运行了一下,启动mysqld竟然成功了。(知道原因的朋友可以帮忙解析一下)

“`

1 0
原创粉丝点击