赞
踩
准备工作
按照官方文档 用Composer安装
要安装phpMyAdmin,只需运行:
composer create-project phpmyadmin/phpmyadmin
建立网站配置文件
网站文件按照惯例放在 /var/www/html/phpmyadmin ,如果前面 composer 的时候放在了其他目录,请 mv 到这里
Apache HTTP Server 的 配置文件放在 /etc/httpd/conf.d ,在这里新建一个phpmyadmin.conf 文件
ls
autoindex.conf php.conf phpmyadmin.conf README test.conf userdir.conf welcome.conf
cat phpmyadmin.conf
# # This configuration file enables the default "Welcome" page if there # is no default index page present for the root URL. To disable the # Welcome page, comment out all the lines below. # # NOTE: if this file is removed, it will be restored on upgrades. # <LocationMatch "^/+$"> Options -Indexes ErrorDocument 403 /.noindex.html </LocationMatch> <Directory /usr/share/httpd/noindex> AllowOverride None Require all granted </Directory> Alias /phpmyadmin /var/www/html/phpmyadmin
修改 phpmyadmin 的配置文件
cd /var/www/html/phpmyadmin/
cp config.sample.inc.php config.inc.php
本次准备让 phpmyadmin 管理多个mysql ,使用, mysql 另外存放在其他服务器 ,因此,提前奢姿 mysql 允许其他 ip 访问
phpmyadmin 网站 IP : 192.168.0.113
mysql 数据库 IP :192.168.0.111
简单抄录一下 mysql 操作
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Password@123' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> select user,host from user;
配置多个 mysql
本次简单重复 2 次 192.168.0.111 来模拟结果
按照官方文档 服务器连接设置
服务器连接设置
$cfg['Servers']
类型: 数组
默认值: 一个服务器数组,下面列出了设置
注释
注解
$cfg['Servers'] 数组由 $cfg[‘Servers’][1] 开始。请勿使用 $cfg[‘Servers’][0]。若您需要多个服务器,请复制(包含自增的 $i)多次。您不需要设置所有服务器数组,设置您要修改的值即可。
网上许多文章建议改写成 $server_hosts = array… 方式,如果您管理的不是很多,就个位数的几台,简单复制代码似乎更简单易懂
vim config.inc.php
...... $cfg['blowfish_secret'] = 'WZH@20230310'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ /** * Servers configuration */ $i = 0; /** * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = '192.168.0.111'; //'localhost'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; # add by wzh 20230310 /** * Second server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = '192.168.0.111'; //'localhost'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; ......
登录时直接选择哪一个服务器
已经登录,切换服务器
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。