Site material in: https://i.cnblogs.com/Files.aspx
First, you need to build a local Yum source, for more information:
Http://www.cnblogs.com/jw35/p/5967677.html
I use CentOS 7 as a Web server, CentOS 5 store data
Configure CentOS 7 First
Configure IP
vi/etc/sysconfig/network-scripts/ifcfg-eno16777736 #编辑网卡配置文件, eno16777736 for NIC name
My CentOS 7 is set to IP 192.168.100.135
Yum Install httpd-y #安装Apache服务 yuminstall php-y #安装php服务 Yum Install php-mysql-y #使php与mysql相连接systemctl stop firewalld.service 0 #临时关闭selinux
Upload the Web file to the/var/www/html directory
Modify the connect.php file
$host ="192.168.100.235"; #地址 $db _user="aa01"; #用户名 $db _pass="123"; #密码 $db _name="xyq"; #库名
Restart Apache
Systemctl Restart Httpd.service
CentOS 5 Configuration
Configure IP
Ifconfig eth0 192.168.100.235 255.255.255.0 #给eth0网卡临时添加IP
Service Iptables Stop #临时关闭防火墙
Setenforce 0 #临时关闭selinux
Build local Yum Source
Yum InstallMysql-server-y #安装mysqlservice mysqld restart #重启mysqlmysql #进入数据库show dat abases; #查看所有数据库create User'AA01'@'192.168.100.135'Identified by'123'; #给192.168.100.135 Create a user, that is, create a user only in 192.168.100. 135 login CREATE DATABASE Xyq; #创建xyq数据库grant all privileges on XYQ.* To'AA01'@'192.168.100.135'; #给某个用户加上指定数据库的权限, *represent all tables with use XYQ; #进入数据库show Tables #查看表
Then copy the SQL statement in
Quit #退出数据库
As a result
Linux build PHP website wishing wall