关于yum安装lamp作一些记录

在centos中使用yum安装lamp比较方便,

apache安装:yum install httpd

php安装:yum install php

mysql安装:yum install mysqld

安装mysql之后要设置密码,然后输入命令:mysql_secure_installation;

系统提示:

In order to log into MySQL to secure it, we'll need the current

password for the root user. If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):   (一般刚装上mysql,root没有密码,在此直接Enter)

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] Y

New password: 12345678    //设定新密码

Re-enter new password:12345678   //再次确认密码

之后一路Enter就可以了

让PHP支持mysql

yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc  php-mbstring

.配置httpd、mysqld开机自启动

chkconfig mysqld on
chkconfig httpd on

 

重启httpd,

 

你可能感兴趣的:(关于yum安装lamp作一些记录)