首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS 7.0 yum安装Apache、PHP和MySQL

CentOS 7.0 yum安装Apache、PHP和MySQL

作者头像
96php.cn
发布2018-04-28 15:07:12
1.6K0
发布2018-04-28 15:07:12
举报
文章被收录于专栏:www.96php.cnwww.96php.cn

‍‍centos7默认将mariadb视作mysql。

卸载mariadb才能安装mysql。

卸载mariadb的方法:

#列出所有被安装的rpm package 

rpm -qa | grep mariadb

‍‍#逐个删除每一个列出来的文件,--nodeps强制删除‍‍

rpm -e --nodeps mariadb- libs-************.x86_64

官网下载安装mysql-server

wget  
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

安装Apache, PHP, MySQL以及php连接mysql库组件。

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

安装apache扩展

yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

安装php的扩展

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

安装MySQL的扩展

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

配置开机启动服务

#/sbin/chkconfig httpd on             [设置apache服务器httpd服务开机启动]
#/sbin/service httpd start            [启动httpd服务,与开机启动无关]
#/sbin/service mysqld start           [启动mysqld服务,与开机启动无关]

初次安装mysql是root账户是没有密码的

mysql -u root
set password for root@localhost = password('123456');
exit

apache命令

systemctl start httpd #启动apache      或者是:service httpd start     

systemctl stop httpd #停止apache        或者是:service httpd stop

systemctl restart httpd #重启apache     或者是:service httpd restart

systemctl enable httpd #设置apache开机启动      或者是:service httpd enable

mysql命令

systemctl enable mysqld    #开机启动  或者: service mysql enable
systemctl start mysqld     #启动服务   或者: service mysql start
systemctl restart mysqld    #重启服务  或者: service mysql restart
systemctl stop  mysqld     #停止服务   或者:service mysqld stop
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年3月15日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档