配置yum仓库,sohu的相当好用。
2、替换源
- cd /etc/yum.repos.d/
- cp CentOS-Base.repo CentOS-Base.repo.bak
- [base]
- name=CentOS-Base
- baseurl=http://mirrors.sohu.com/centos/$releasever/os/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
- #released updates
- [updates]
- name=CentOS-Updates
- baseurl=http://mirrors.sohu.com/centos/$releasever/updates/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
- #packages used/produced in the build but not released
- [addons]
- name=CentOS-Addons
- baseurl=http://mirrors.sohu.com/centos/$releasever/addons/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that may be useful
- [extras]
- name=CentOS-Extras
- baseurl=http://mirrors.sohu.com/centos/$releasever/extras/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-Plus
- baseurl=http://mirrors.sohu.com/centos/$releasever/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
- yum -y update
- yum install httpd httpd-devel
- yum install mysql mysql-server mysql-devel
- /usr/local/mysql/bin/mysqladmin -u root -p password 新密码
- enter password 旧密码
- mysql> update mysql.user set passwordpassword=password(”新密码”)where User=”root”;
- mysql> flush privileges;
- mysql> quit ;
- killall mysqld
- /usr/local/mysql/bin/mysql -u root -p (要求输入密码时直接回车即可)
- mysql> update user mysql.set passwordpassword=password(”新密码”) where user=”root”;
- mysql> flush privileges;
- mysql> quit;
- killall mysqld
- chkconfig mysqld on
- yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
- /etc/init.d/httpd start
- <?
- phpinfo();
- ?>
6、mysql遇到:
- yum -y install php* --skip-broken 就可以解决问题了
- /etc/rc.d/init.d/mysqld status
- service mysqld start