五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動(dòng)態(tài)

CentOS7+apache+php7+mysql5.7配置教程詳解

發(fā)布日期:2022-05-14 12:51 | 文章來源:gibhub
 yum upgrade
yum install net-tools

安裝apache

關(guān)閉SELinux

編輯器打開 etc/selinux/config 文件,找到 SELINUX=enforcing 字段,將其改成 SELINUX=disabled ,并重啟設(shè)備。

yum -y install httpd mod_ssl

配置防火墻

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload

開機(jī)啟動(dòng)

systemctl start httpd
systemctl enable httpd

終端輸入如下指令檢查httpd的運(yùn)行狀態(tài)

sudo systemctl status httpd

安裝PHP7

添加源

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安裝

yum install php70w

安裝mysql5.7

1.安裝wget

  yum -y install wget

2.安裝源

 wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
  rpm -ivh mysql57-community-release-el7-8.noarch.rpm

3.安裝mysql

  yum install mysql-server

4.啟動(dòng)mysql服務(wù)

 systemctl start mysqld

5.查看MySQL的啟動(dòng)狀態(tài)

 systemctl status mysqld

6.開機(jī)啟動(dòng)

 systemctl enable mysqld
  systemctl daemon-reload

7.修改root本地登錄密碼

查找mysql生成的隨機(jī)密碼

 grep 'temporary password' /var/log/mysqld.log
  mysql -uroot -p

修改密碼,注意:mysql5.7默認(rèn)安裝了密碼安全檢查插件(validate_password),默認(rèn)密碼檢查策略要求密碼必須包含:大小寫字母、數(shù)字和特殊符號,并且長度不能少于8位。否則會(huì)提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements錯(cuò)誤

  ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

8.配置默認(rèn)編碼為utf8

修改/etc/my.cnf配置文件,在[mysqld]下添加編碼配置

 [mysqld]
  character_set_server=utf8
  init_connect='SET NAMES utf8'

9.配置mysql遠(yuǎn)程連接

  mysql -uroot -p
  use mysql;
  Grant all on *.* to 'root'@'%' identified by 'root用戶的密碼' with grant option;
flush privileges;

然后用以下命令查看哪些用戶和host可以訪問,%代表任意ip地址

select user,host from user;

防火墻添加3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload

10.mysql忘記密碼

1.修改MySQL的配置文件(默認(rèn)為/etc/my.cnf),在[mysqld]下添加一行skip-grant-tables

2.service mysqld restart后,即可直接用mysql進(jìn)入

3.

mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
  mysql> flush privileges;
  mysql> quit;

將/etc/my.cnf文件還原,重新啟動(dòng)mysql:service mysql restart,這個(gè)時(shí)候可以使用mysql -u root -p'123qwe'進(jìn)入了

mysql>SET PASSWORD = PASSWORD('newpasswd'); 設(shè)置新密碼

總結(jié)

以上所述是小編給大家介紹的CentOS7+apache+php7+mysql5.7配置教程詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對本站網(wǎng)站的支持!

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部