centos搭建PHP的常见问题汇总

问题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:80
no listening sockets available, shutting down
Unable 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竟然成功了。(知道原因的朋友可以帮忙解析一下)

“`

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值