yum安装mod auth mysql_CentOS 7.0 yum安装Apache、PHP和MySQL

本文详细介绍如何在CentOS7上卸载MariaDB并安装MySQL,包括安装必要的Apache、PHP及MySQL组件,以及配置相关服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考网址:https://jingyan.baidu.com/article/9c69d48f87ff2913c8024e69.html

centos7默认将mariadb视作mysql。

p.s.因为mysql被oracle收购后,原作者担心mysql闭源,所以又写了一个mariadb,这个数据库可以理解为mysql的分支。

卸载mariadb才能安装mysql。

卸载mariadb的方法:

#列出所有被安装的rpm package

rpm -qa | grep mariadb

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

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

官网下载安装mysql-server

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

# 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

开启80端口

//开启80端口

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

service iptables save//重启防火墙

service iptables restart

配置开机启动服务

#/sbin/chkconfig httpd on [设置apache服务器httpd服务开机启动]

#/sbin/service httpd start [启动httpd服务,与开机启动无关]

#/sbin/service mysqld start [启动mysqld服务,与开机启动无关]

说明:

apache的配置文件是/etc/httpd/conf下

modules放在/usr/lib/httpd下

php的配置文件在/etc/php.d/下 和/etc/php.ini

php的modules放在/usr/lib/php/modules下

绑定域名

在/etc/httpd/conf/httpd.conf配置文件中,提供了范例:

#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

#

# ServerAdmin webmaster@dummy-host.example.com

# DocumentRoot /www/docs/dummy-host.example.com

# ServerName dummy-host.example.com

# ErrorLog logs/dummy-host.example.com-error_log

# CustomLog logs/dummy-host.example.com-access_log common

#

说明:

MySQL默认安装的后,root密码为空.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值