一、安裝Mysql

1、解除安裝預設的mysql

yum -y remove mysql-libs-*

Removed:
  mysql-libs.x86_64 0:5.1.73-3.el6_5

解除安裝成功

2、上傳四個檔案,然後rpm

rpm -ivh MySQL-server-5.6.-.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.-.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.-.el6.x86_64.rpm
rpm -ivh MySQL-shared-5.6.-.el6.x86_64.rpm

說明:如果第一步沒有解除安裝,會出現包衝突

出現問題一:
file /usr/share/man/man1/mysqlshow.1.gz from install of MySQL-client-4.1.16-1.glibc23
conflicts with file from package mysql-3.23.54a-11----------------------------------------------------------解決方案:解除安裝軟體原因有包衝突。解決衝突: 
yum -y remove mysql-libs-*
yum -y remove mysql-libs-5.1.61*        -y的意思就是不用詢問是否remove
解除安裝完成之後,再安裝MySQL成功了

3、開啟Mysql

/etc/init.d/mysql start 

4、

第一次如何登陸mysql呢
1、su命令【root使用者就不需要了】
2、/etc/init.d/mysql start 開啟mysql
3、mysql -uroot -p
在這個目錄下找密碼/root/.mysql_secret
cd /root
ls -la
cat .mysql_secret 複製密碼【複製貼上即可】

5、修改密碼

set password=password('admin');

6、其他問題

其他問題:

/etc/init.d/mysql stop
/etc/init.d/mysql start 開啟mysql
檢視一下這個目錄cd /etc/rc.d/init.d/
檢視mysql啟動狀態/etc/rc.d/init.d/mysql status

第二部分:安裝apache

1、上傳對應的檔案

tar zxvf httpd-2.2.27.tar.gz 
2、  cd httpd-2.2.27
3、  ./configure --prefix=/usr/local/apache2 --enable-dav --enable-modules=so
4、 make
5、  make install

-----------------------------------

make[1]: Leaving directory `/usr/local/httpd-2.2.27' 代表OK

6、啟動apache

/usr/local/apache2/bin/apachectl start

出現錯誤:

httpd: apr_sockaddr_info_get() failed for VM_74_204_centos
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

-------------------------------

解決方案:

在Apache的安裝目錄下的hhtpd。conf檔案修改如下【  cd apache2/conf  ls一下】
   (1) ServerName localhost:80

第三部分:安裝php

安裝前要準備安裝libxml2, 上傳百度雲這個檔案到usr/local

1 tar zxvf libxml2-2.6.32.tar.gz
2 cd libxml2-2.6.32
3 ./configure --prefix=/usr/local/libxml2
4 make
5 make install

安裝Php

1、tar zxvf php-5.3.28.tar.gz 
 2、 cd php-5.3.28
 3、 ./configure --prefix=/usr/local/php --with-mysqli=/usr/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

出現這個,成功安裝php

------------------------

繼續:
4、make 
5、make install

----------------------

輸入IP地址

http://182.92.227.100/ 出現itworks 就代表成功了【其實Apache第二步開啟了,就可以測試是否成功了】

這一篇安裝過程講到這

下一篇文章為他們的配置問題。

Apache支援php,php載入mysql的文章