//注:配置完成后再修改权限时不能一键修改所有目录权限,只修改根目录
--------------------------------------------------------------------
首先安装yum包
yum -y install wget
1.安装mysql
安装与配置
https://www.cnblogs.com/ianduin/p/7679239.html
安装后,首先查看默认的随机密码
grep 'temporary password' /var/log/mysqld.log
ti<45iij6>sH
登录mysql修改密码策略
mysql -u root -p
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password_policy=LOW;
set global validate_password_length=6;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
修改密码策略
https://blog.csdn.net/hello_world_qwp/article/details/79551789
2.安装Apache
yum install httpd
启动Apache
https://blog.csdn.net/aerchi/article/details/80859894
systemctl start httpd.service #启动
systemctl stop httpd.service #停止
systemctl restart httpd.service #重启
systemctl enable httpd.service #开机启动
systemctl disable httpd.service #开机不启动
systemctl status httpd.service
3.安装PHP
下载PHP安装包
ps -ef |grep php
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install -y php70w php70w-bcmath php70w-devel php70w-gd * php70w-pdo*
yum install php-fpm php70w php70w-cli php70w-common php70w-gd php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-pdo php70w-bcmath php70w-devel
yum install httpd
yum install -y php70w
yum list php70w*
在Apache配置文件 vi /etc/httpd/conf/httpd.conf 关联PHP
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
LoadModule php7_module modules/libphp7.so
关联PHP
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
修改完后重启Apache
systemctl restart httpd.service
4.安装svn
直接关闭防火墙
systemctl status firewalld.service
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
yum install subversion
5.修改权限
chmod -R 777 ./ (就是这一句导致重启后密码错误)
chmod -R 777 html/
ll html
/usr/sbin/sestatus -v
查看 SELinux状态及关闭SELinux
https://blog.51cto.com/bguncle/957315
vi /etc/selinux/config
SELINUX=enforcing改为SELINUX=disabled
https://blog.csdn.net/qq_33595128/article/details/80774612
svn co https://47.75.155.180/svn/oms_erp /var/www/html/
6.修改root密码
https://blog.csdn.net/shanvlang/article/details/80385913
7.数据库设置远程登录
mysql -u root -p
show databases;
use mysql;
show tables;
修改root远程访问
use mysql;
update user set host = '%' where user = 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
更新数据库
FLUSH PRIVILEGES;
1、首先建空数据库
mysql>create database abc;
2、导入数据库
方法一:
(1)选择数据库
mysql>use abc;
(2)设置数据库编码
mysql>set names utf8;
pdo报错could not find driver解决办法
1、原因是没有pdo扩展导致的,
2、解决办法:打开php.ini,然后去掉以下两行代码之前的分号(;)即可。如下;
extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
没有的直接加入到配置文件
//修改密码的时候出现错误用下面的方法修改
vim /etc/my.cnf
在 [mysqld]中添加 skip-grant-tables 保存退出
重启mysql
在mysql命令行输入 update mysql.user set password=PASSWORD('新密码')where User='root';
命令行输入 flush privileges; 并退出。
mysql> update user set password=password("*******") where user="*******"; #修改密码报错
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('*******') where user='*******'; #修改密码成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
进入 vim /etc/my.cnf
将第一步中的修改去除,并保存。