Linux安裝配置PHPmyadmin

進官網下載zip安裝包php

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.ziphtml

安裝解壓工具nginx

yum install unzip –y數據庫

解壓安裝包vim

unzip unzip phpMyAdmin-5.0.1-all-languages.zip瀏覽器

把解壓好的文件移動到/www/phpMyAdmin下面安全

mv phpMyAdmin-5.0.1-all-languages/* /www/phpMyAdmin/服務器

cd /www/phpMyAdmin php-fpm

複製重命名一份配置文件工具

cp config.sample.inc.php config.php

進入/etc/nginx/conf.d

建立一個配置文件phpMyAdmin.conf

添加如下代碼

server {
      listen       880;
      server_name  localhost;
  root /www/phpMyAdmin;
      location / {
          index  index.php index.html index.htm;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
      location ~ \.php$ {
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
          include        fastcgi.conf;
      }
}

在/etc/nginx/nginx.conf中引入配置文件

(include conf.d/phpMyAdmin.conf;)

在服務器中打開安全組端口,瀏覽器中輸入相應的ip:880進入登陸頁面、

cd /www/phpMyAdmin/

cp libraries/config.default.php config.inc.php

vim config.inc.php

端口號改成3306

$cfg['Servers'][$i]['port'] = '3306';

修改root密碼:

$cfg['Servers'][$i]['password'] = '******';

修改成本地地址

$cfg['Servers'][$i]['host'] = '127.0.0.1';

重啓php服務器

systemctl restart php-fpm

而後就能訪問PHPmyadmin數據庫了

相關文章
相關標籤/搜索