部署lamp

部署lamp


1.web服务器工作流程

web服务器的资源分为两种,静态资源和动态资源:

  • 静态资源就是指静态内容,客户端从服务器获得的资源的表现形式与原文件相同。可以简单的理解为就是直接存储于文件系统中的资源
  • 动态资源则通常是程序文件,需要在服务器执行之后,将执行的结果返回给客户端

2.安装httpd

2.1apr,apr-util,httpd服务
//配置yum源
[root@hwf ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
[root@hwf ~]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
//下载软件包
[root@hwf ~]# dnf -y install epel-release vim

//安装开发工具包
[root@hwf ~]# dnf groups mark install 'Development Tools'

//创建apache用户
[root@hwf ~]# useradd -r -M -s /sbin/nologin apache
[root@hwf ~]# id apache
uid=995(apache) gid=992(apache) groups=992(apache)

//安装依赖包
[root@hwf ~]# yum -y install openssl-devel pcre-devel expat-devel libtool gcc gcc-c++

//下载和安装apr以及apr-util
[root@hwf ~]# wget https://mirrors.aliyun.com/apache/apr/apr-1.7.0.tar.gz
[root@hwf ~]# wget https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz
[root@hwf src]# tar xf apr-1.7.0.tar.gz 
[root@hwf src]# tar xf apr-util-1.6.1.tar.gz 
[root@hwf src]# ls
apr-1.7.0  apr-1.7.0.tar.gz  apr-util-1.6.1  apr-util-1.6.1.tar.gz


//编译安装apr
[root@hwf src]# cd apr-1.7.0/
[root@hwf apr-1.7.0]# vim configure
 cfgfile=${ofile}T
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
    #$RM "$cfgfile"				//将此行注释掉
    
[root@hwf apr-1.7.0]# ./configure --prefix=/usr/local/apr
//安装编译工具
[root@hwf apr-1.7.0]# dnf -y install make
//编译安装
[root@hwf apr-1.7.0]# make && make install

[root@hwf apr-util-1.6.1]# cd apr-util-1.6.1/
[root@hwf apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
//编译安装
[root@hwf apr-util-1.6.1]# make && make install

//安装httpd软件包
[root@hwf src]# wget https://mirrors.aliyun.com/apache/httpd/httpd-2.4.54.tar.gz
//解压
[root@hwf src]# tar xf httpd-2.4.54.tar.gz 
[root@hwf src]# ls
apr-1.7.0  apr-1.7.0.tar.gz  apr-util-1.6.1  apr-util-1.6.1.tar.gz  httpd-2.4.54  httpd-2.4.54.tar.gz

//编译安装httpd服务
[root@hwf httpd-2.4.54]#  ./configure --prefix=/usr/local/apache --enable-so  --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all  --with-mpm=prefork
[root@hwf httpd-2.4.54]# make && make install
2.2关闭防火墙和色Linux,配置环境变量
[root@hwf ~]# systemctl status firewalld.service 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@hwf ~]# cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

//配置环境变量
[root@hwf bin]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/apache.sh
[root@hwf bin]# source /etc/profile.d/apache.sh 
[root@hwf bin]# which apachectl 
/usr/local/apache/bin/apachectl
//给头文件做软连接
[root@hwf apache]# ln -s /usr/local/apache/include/ /usr/include/apache
//生效apache的man帮助文档
[root@hwf apache]# vim /etc/man_db.conf 
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
MANDATORY_MANPATH                       /usr/local/apache/man


//设置apache服务开机自启
[root@hwf apache]# vim /usr/lib/systemd/system/httpd.service 
[Unit]
Description=web server daemon
Documentation=man:httpd(5)
After=network.target sshd-keygen.target

[Service]
Type=forking
ExecStart=/usr/local/apache/bin/apachectl start
ExecStop=/usr/local/apache/bin/apachectl stop
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
[root@hwf apache]# systemctl restart httpd
[root@hwf apache]# ss -anlt
State      Recv-Q      Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0           128                    0.0.0.0:111                 0.0.0.0:*                    
LISTEN     0           128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0           128                       [::]:111                    [::]:*                    
LISTEN     0           128                          *:80                        *:*                    
LISTEN     0           128                       [::]:22                     [::]:*         

//取消注释
[root@hwf ~]# cd /usr/local/apache/conf
[root@hwf conf]# vim httpd.conf
ServerName www.example.com:80        			//取消此行注释

3.1安装mysql

//安装依赖包
[root@hwf ~]# dnf -y install ncurses-devel openssl-devel openssl cmake mariadb-devel
[root@hwf ~]# useradd -r -M -s /sbin/nologin mysql
[root@hwf ~]# id mysql		//创MySQL用户
uid=994(mysql) gid=991(mysql) groups=991(mysql)

//将事先下载好的mysql二进制包拉取到虚拟机当中
[root@hwf src]# ls
apr-1.7.0         apr-util-1.6.1.tar.gz  mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
apr-1.7.0.tar.gz  httpd-2.4.54
apr-util-1.6.1    httpd-2.4.54.tar.gz
//解压MySQL包
[root@hwf src]# tar -xf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz 
[root@hwf src]# ls
apr-1.7.0         apr-util-1.6.1.tar.gz  mysql-5.7.38-linux-glibc2.12-x86_64
apr-1.7.0.tar.gz  httpd-2.4.54           mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
apr-util-1.6.1    httpd-2.4.54.tar.gz

//给MySQL创建软链接
[root@hwf src]# ln -s mysql-5.7.38-linux-glibc2.12-x86_64 mysql
[root@hwf src]# ll
total 670160
drwxr-xr-x 28 1001  1001      4096 Aug  2 19:48 apr-1.7.0
-rw-r--r--  1 root root    1093896 Apr  5  2019 apr-1.7.0.tar.gz
drwxr-xr-x 21 1001  1001      4096 Aug  2 19:50 apr-util-1.6.1
-rw-r--r--  1 root root     554301 Oct 23  2017 apr-util-1.6.1.tar.gz
drwxr-xr-x 13  504 games      4096 Aug  2 19:57 httpd-2.4.54
-rw-r--r--  1 root root    9743277 Jun  8 16:42 httpd-2.4.54.tar.gz
lrwxrwxrwx  1 root root         35 Aug  2 20:23 mysql -> mysql-5.7.38-linux-glibc2.12-x86_6

//修改MySQL的属主属组
[root@hwf src]# chown -R mysql.mysql mysql
[root@hwf src]# ll
total 670160
drwxr-xr-x 28  1001  1001      4096 Aug  2 19:48 apr-1.7.0
-rw-r--r--  1 root  root    1093896 Apr  5  2019 apr-1.7.0.tar.gz
drwxr-xr-x 21  1001  1001      4096 Aug  2 19:50 apr-util-1.6.1
-rw-r--r--  1 root  root     554301 Oct 23  2017 apr-util-1.6.1.tar.gz
drwxr-xr-x 13   504 games      4096 Aug  2 19:57 httpd-2.4.54
-rw-r--r--  1 root  root    9743277 Jun  8 16:42 httpd-2.4.54.tar.gz
lrwxrwxrwx  1 mysql mysql        35 Aug  2 20:23 mysql -> mysql-5.7.38-linux-glibc2.12-x86_64
drwxr-xr-x  9 root  root        129 Aug  2 20:21 mysql-5.7.38-linux-glibc2.12-x86_64
-rw-r--r--  1 root  root  674830866 Aug  2 20:20 mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz

//配置环境变量
[root@hwf mysql]# echo 'export PATH=/usr/local/src/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@hwf mysql]# source /etc/profile.d/mysql.sh 
[root@hwf mysql]# which mysql
/usr/local/src/mysql/bin/mysql	


[root@hwf mysql]# ln -s /usr/local/src/mysql/include/ /usr/include/mysql		//给头文件创建软连接
[root@hwf mysql]# vim /etc/ld.so.conf.d/mysql.conf
/usr/local/src/mysql/lib

//生效MySQL的man帮助文档
[root@hwf mysql]# vim /etc/man_db.conf
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
MANDATORY_MANPATH                       /usr/local/apache/man
MANDATORY_MANPATH                       /usr/local/mysql/man


//创建MySQL存放数据目录
[root@hwf mysql]# mkdir /opt/data
[root@hwf mysql]# chown  -R mysql.mysql /opt/data/
[root@hwf mysql]# ll /opt/			//将MySQL数据存放目录的属主属组改为mysql
total 0
drwxr-xr-x 2 mysql mysql 6 Aug  2 20:30 data


//初始化数据库
[root@hwf mysql]# mysqld --initialize --user mysql --datadir /opt/data
2022-08-02T12:32:29.424040Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-08-02T12:32:29.424100Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2022-08-02T12:32:29.731596Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-08-02T12:32:29.940925Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-08-02T12:32:29.983401Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 2cb87a62-125f-11ed-9d14-000c291ef509.
2022-08-02T12:32:29.983873Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-08-02T12:32:30.258144Z 0 [Warning] 
2022-08-02T12:32:30.258167Z 0 [Warning] 
2022-08-02T12:32:30.258704Z 0 [Warning] CA certificate ca.pem is self signed.
2022-08-02T12:32:30.347522Z 1 [Note] A temporary password is generated for root@localhost: L,fw:#3mX,Qt


//删除mariadb的所有包
[root@hwf ~]# yum -y remove mariadb*

//生成启动配置文件
[root@hwf ~]# vim /etc/my.cnf 
[mysqld]
basedir = /usr/local/src/mysql                  
datadir = /opt/data                                     
socket = /tmp/mysql.sock                        
port = 3306
pid-file = /opt/data/mysql.pid          
user = mysql                                            
skip-name-resolve
sql-mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


[root@hwf ~]# cp /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/mysql.service
[root@hwf ~]# vim /usr/lib/systemd/system/mysql.service
[Unit]
Description=mysql server daemon
After=network.target sshd-keygen.target

[Service]
Type=forking
ExecStart=/usr/local/src/mysql/support-files/mysql.server start
ExecStop=/usr/local/src/mysql/support-files/mysql.server stop
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

//重新读取一下配置文件,然后重启服务
[root@hwf ~]# systemctl daemon-reload 
[root@hwf ~]# systemctl restart mysql.service 
[root@hwf ~]# ss -anlt
State      Recv-Q      Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0           128                    0.0.0.0:111                 0.0.0.0:*                    
LISTEN     0           128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0           80                           *:3306                      *:*                    
LISTEN     0           128                       [::]:111                    [::]:*                    
LISTEN     0           128                          *:80                        *:*                    
LISTEN     0           128                       [::]:22                     [::]:*      

[root@hwf ~]# dnf -y install ncurses-compat-libs  //安装软件包

//登录数据库修改密码
[root@hwf ~]# mysql -uroot -pL,fw:#3mX,Qt
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.38

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set password = password ('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye


//配置服务启动脚本
[root@hwf ~]#  cp -a /usr/local/src/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@hwf ~]# vim /etc/init.d/mysqld 
basedir=/usr/local/src/mysql
datadir=/opt/data

[root@hwf ~]# chkconfig --add mysql			//设置开机自启
[root@hwf ~]# chkconfig 

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off

4.安装php

//下载php包
[root@hwf ~]# wget https://www.php.net/distributions/php-7.4.30.tar.xz
[root@hwf ~]# ls
anaconda-ks.cfg  php-7.4.30.tar.xz  pubic
[root@hwf ~]# sha256sum php-7.4.30.tar.xz 
ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d  php-7.4.30.tar.xz

//安装依赖包
[root@hwf ~]# yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel  pcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php-mysqlnd

[root@hwf ~]# tar xf php-7.4.30.tar.xz 		//解压软件包
[root@hwf ~]# cd php-7.4.30/

//安装包
[root@hwf php-7.4.30]# dnf -y install libsqlite3x-devel
[root@hwf php-7.4.30]# dnf -y install https://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/oniguruma-devel-6.8.2-2.el8.x86_64.rpm
[root@hwf php-7.4.30]# dnf -y install libzip-devel

[root@hwf php-7.4.30]#./configure --prefix=/usr/local/php7  \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-openssl \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif  \
--enable-ftp \
--enable-gd \
--with-jpeg \
--with-zlib-dir \
--with-freetype \
--with-gettext \
--enable-json \
--enable-mbstring \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-readline \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--with-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-pcntl \
--enable-posix

//make编译
[root@hwf php-7.4.30]# make
//安装
[root@hwf php-7.4.30]# make install

//配置环境变量
[root@hwf local]# echo 'export PATH=/usr/local/php7/bin:$PATH' > /etc/profile.d/php7.sh
[root@hwf local]# source /etc/profile.d/php7.sh
[root@hwf local]# which php
/usr/local/php7/bin/php

//配置php-fpm
[root@hwf php-7.4.30]# cp php.ini-production /etc/php.ini
cp: overwrite '/etc/php.ini'? y
[root@hwf php-7.4.30]# cd sapi
[root@hwf sapi]# ls
apache2handler  cgi  cli  embed  fpm  litespeed  phpdbg
[root@hwf sapi]# cd fpm/
[root@hwf fpm]# ls
config.m4       init.d.php-fpm.in  php-fpm.8        php-fpm.service     tests
CREDITS         LICENSE            php-fpm.8.in     php-fpm.service.in  www.conf
fpm             Makefile.frag      php-fpm.conf     status.html         www.conf.in
init.d.php-fpm  php-fpm            php-fpm.conf.in  status.html.in
[root@hwf fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@hwf fpm]# chmod +x /etc/init.d/php-fpm 
[root@hwf ~]# cd /usr/local/php7/
[root@hwf php7]# cd etc/
[root@hwf etc]# ls
pear.conf  php-fpm.conf.default  php-fpm.d
[root@hwf etc]# cp php-fpm.conf.default php-fpm.conf
[root@hwf etc]# ls
pear.conf  php-fpm.conf  php-fpm.conf.default  php-fpm.d
[root@hwf etc]# cd php-fpm.d/
[root@hwf php-fpm.d]# ls
www.conf.default
[root@hwf php-fpm.d]# cp www.conf.default www.conf
[root@hwf php-fpm.d]# ls
www.conf  www.conf.default
[root@hwf php-fpm.d]# service php-fpm start
Starting php-fpm  done
[root@hwf php-fpm.d]# ss -anlt
State      Recv-Q      Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0           128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0           128                  127.0.0.1:9000                0.0.0.0:*                    
LISTEN     0           128                    0.0.0.0:111                 0.0.0.0:*                    
LISTEN     0           128                       [::]:22                     [::]:*                    
LISTEN     0           80                           *:3306                      *:*                    
LISTEN     0           128                       [::]:111                    [::]:*                    
LISTEN     0           128                          *:80                        *:*                    
[root@hwf php-fpm.d]# chkconfig --add php-fpm 	//设置开机自启
[root@hwf php-fpm.d]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off
php-fpm        	0:off	1:off	2:on	3:on	4:on	5:on	6:off

5.配置apache

5.1启用代理模块

//取消注释这两行
[root@hwf ~]# vim /usr/local/apache/conf/httpd.conf 
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
5.2配置虚拟主机
[root@hwf ~]# vim /usr/local/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
    DocumentRoot "/usr/local/apache/htdocs/runtime"
    ServerName runtime.example.com
    ErrorLog "logs/runtime.example.com-error_log"
    CustomLog "logs/runtime.example.com-access_log" common
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/runtime/$1
    <Directory "/usr/local/apache/htdocs/runtime">
        Options none
        AllowOverride none
        Require all granted
    </Directory>

</VirtualHost>

//创建虚拟主机目录并生成php测试页面
[root@hwf ~]# mkdir /usr/local/apache/htdocs/runtime
[root@hwf ~]# vim /usr/local/apache/htdocs/runtime/index.php
<?php
   phpinfo();
?>
[root@hwf ~]# chown -R apache.apache /usr/local/apache/htdocs/runtime/		

[root@hwf ~]# vim /usr/local/apache/conf/httpd.conf
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php       		//添加此行
    AddType application/x-httpd-php-source .phps	//添加此行

Include conf/extra/httpd-vhosts.conf		//取消注释此行

<IfModule dir_module>
    DirectoryIndex index.php index.html		//添加前面这一段index.php
</IfModule>

//重启服务
[root@hwf ~]# systemctl restart httpd
[root@hwf ~]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                  127.0.0.1:9000                0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:111                 0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          80                           *:3306                      *:*                    
LISTEN     0          128                       [::]:111                    [::]:*                    
LISTEN     0          128                          *:80                        *:*                    
LISTEN     0          128                       [::]:22                     [::]:*    

//测试
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-j7wKkfQe-1659538935457)(https://wx1.sinaimg.cn/mw2000/006EnvMhgy1h4tw39br7sj31hb0ty000.jpg)]

6.安装phpmyadmin

//在网址中下载包
[root@hwf ~]# wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
[root@hwf ~]# tar xf phpMyAdmin-5.2.0-all-languages.tar.gz -C /usr/local/apache/htdoce/runtime/

[root@hwf runtime]# mv phpMyAdmin-5.2.0-all-languages/ phpmyadmin

[root@hwf runtime]# cd phpmyadmin/
[root@hwf phpmyadmin]# cp config.sample.inc.php config.inc.php
//进入libraries目录下,打开config.default.php文件将本机ip地址写入
[root@hwf phpmyadmin]# cd libraries/
[root@hwf libraries]# vim config.default.php
//1、访问网址
$cfg['PmaAbsoluteUri'] = '192.168.159.100';

//2、MySQL 主机信息
$cfg['Servers'][$i]['host'] = 'localhost'; 			//如果 MySQL 和该 phpMyAdmin 在同一服务器,则按默认 localhost
$cfg['Servers'][$i]['port'] = '';		//MySQL 端口,默认为 3306,保留为空即可

//3、MySQL 用户名和密码
$cfg['Servers'][$i]['user'] = 'root'; 	// 填写 MySQL 访问 phpMyAdmin 使用的 MySQL 用户名,默认为 root。
fg['Servers'][$i]['password'] = '123'; // 填写对应上述 MySQL 用户名的密码。

//4、认证方法
$cfg['Servers'][$i]['auth_type'] = 'cookie';		//考虑到安全的因素,建议这里填写 cookie。

5、短语密码
$cfg['blowfish_secret'] = '123';			//如果认证方法设置为 cookie,就需要设置短语密码

7.测试

//在网址输入本地IP地址跟上phpmyadmin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

1we11

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值