基于Apache+php+mysql的许愿墙网站的搭建

配置CentOS7与Linux

两台虚拟机配置yum

在CentOS7中安装httpd与php与php-mysql

关闭防火墙

在Linux中安装mysql

yum install mysql-server -y    

 重启mysql:service mysqld restart

将许愿墙网页放入CentOS7的/var/www/html

输入mysql进入数据库进行管理

输入create user 'abc'@'192.168.100.119' identified by '123456';    

给192.168.100.119创建用户

创建naive数据库 :create database naive

查看mysql中的数据库:show databases

给abc加上权限:grant all privileges on naive.* to 'abc'@'192.168.100.119'

回到CentOS7中的/var/www/html目录,修改connect.php文件

重启httpd服务:service httpd restart。

在浏览器中输入192.168.100.119进入许愿墙

原文地址:https://www.cnblogs.com/jw1519/p/6227275.html