您的位置:首页 > 运维架构 > Linux

Centos6.5 yum安装LAMP环境

2016-04-29 00:00 597 查看
摘要: Centos6.5 yum安装LAMP环境

1. 安装Apahce, PHP, Mysql, 以及php连接mysql库组件

#yum -y install httpd php mysql mysql-server php-mysql

安装mysql扩展

#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

安装php的扩展

# yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc

安装apache扩展

#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

一次性粘贴安装:

# yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql

2. 启动服务配置

# /sbin/chkconfig httpd on [设置apache为自启动]

# /sbin/chkconfig –add mysqld [mysql服务]

# /sbin/chkconfig mysqld on [mysqld服务]

# /sbin/service httpd start [自启动 httpd 服务]

# /sbin/service mysqld start [自启动mysqld服务]

3.设置mysql数据库root帐号密码。

# mysqladmin -u root password ‘zichuanxuwei’ [引号内填密码]

# mysql -u root -p ← 通过空密码用root登录

Enter password:lingzhong ← 在这里输入密码

GRANT ALL PRIVILEGES ON *.* TO 'zichuanxuwei'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; //添加远程连接账户

4.在浏览器中输入IP就可以打开测试页面了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  LAMP Centos php mysql