使用YUM安装LAMP:
apache
- yum install httpd httpd-devel
- etc/init.d/httpd start
mysql
- yum install mysql mysql-server mysql-devel
- /etc/init.d/mysqld start
设置密码
- mysql> USE mysql;
- mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
- mysql> FLUSH PRIVILEGES;
登陆
- mysql -u root -p
- Enter Password:
创建一个用户管理数据库
- mysql > create database demo
- mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest' WITH GRANT OPTION;
- mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';
安装php
- yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
- etc/init.d/httpd restart
设置开机启动
- chkconfig httpd on
- chkconfig mysqld on
【编辑推荐】