安装
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.0/phpMyAdmin-4.7.0-all-languages.tar.gz
tar -zvxf phpMyAdmin-4.7.0-all-languages.tar.gz
#放置根目录下
mv phpMyAdmin-4.7.0-all-languages /opt/nginx/html/
cd /opt/nginx/html/
mv phpMyAdmin-4.7.0-all-languages pma
修改配置文件
cp config.sample.inc.php config.inc.php
vim config.inc.php
#修改ip
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '192.168.163.12';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
访问数据使用IP访问
192.168.163.12
出现1130错误
问题:root用户的host 问题
方法:
mysql -u root -p
mysql>use mysql;
mysql>select 'host' from user where user='root';
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
mysql>select 'host' from user where user='root';
第一句是以权限用户root登录
第二句:选择mysql库
第三句:查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
第四句:修改host值(以通配符%的内容增加主机/IP地址),当然也可以直接增加IP地址
第五句:刷新MySQL的系统权限相关表
第六句:再重新查看user表时,有修改。。
最后重起mysql服务即可完成。
刷新数据库,即可访问
nginx服务器 禁止ip访问,使用域名访问
vim /opt/
#添加
server {
listen 80;
server_name www.nginx_frist.com;
location / {
root /opt/nginx/html;
index index.php index.html index.htm;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
.....
.....
....
#默认禁止ip访问,如果ip访问返回403
server {
listen 80 default_server;
server_name _;
return 403;
}
##也可以把这些流量收集起来,导进到本人的网站,只需做以下跳转设置就可以:
#server {
# listen 80 default;
# rewrite ^(.*) http://www.abc.com;
# }
效果