1. 程式人生 > >Centos7.2之phpadmin安裝配置

Centos7.2之phpadmin安裝配置

數據庫 linux

centos7.2
lamp之phpadmin
PhpMyAdmin是一個以PHP為基礎,以Web-Base方式架構在網站主機上的MySQL的數據庫管理工具,讓管理者可用Web接口管理MySQL數據庫

下載地址:https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip
註意:下載的版本要和當前的php版本和mysql版本相適應,不然不能成功。

~]# yum install httpd php php-mysql mariadb-server 安裝需要的服務
~]#systemctl start httpd 啟動httpd服務

~]#systemctl start mariadb 啟動mysql服務
~]# ss -tnl 查看監聽的端口
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 50 :3306 :
LISTEN 0 128 :::80 :::
:*

~]# systemctl stop firewalld 關閉防火墻
~]# systemctl disable firewalld永久關閉防火墻
~]# setenforce 0 暫時關閉selinux
~]# sed -i "s/^SELINUX\=enforcing/SELINUX\=disabled/g" /etc/selinux/config 永久關閉selinux
~]# unzip phpMyAdmin-4.7.9-all-languages.zip 解壓phpmyadmin

~]# cp -a phpMyAdmin-4.7.9-all-languages /var/www/html/ 復制到指定目錄
html]# ln -s phpMyAdmin-4.7.9-all-languages pma 創建軟連接,方便以後升級
html]# cd pma/
pma]# cp config.sample.inc.php config.inc.php 復制配置文件

~]# tr -d ‘a-z0-9A-Z‘</dev/urandom |head -30 |md5sum
7a1e4b41291c0c74e82ef5a5f528dc82 - 生成隨機字符串
pma]#vim config.inc.php 編輯配置文件
$cfg[‘blowfish_secret‘] = ‘7a1e4b41291c0c74e82ef5a5f528dc82‘;添加隨機字符串

瀏覽器登陸:192.168.1.102/pma
提示:The mbstring extension is missing。
pma]# yum install php-mbstring -y 安裝擴展模塊

pma]# systemctl reload httpd 重新加載,重新登錄

登錄界面
技術分享圖片
MariaDB [(none)]> set password for ‘root‘@‘localhost‘=password(‘magedu‘);
MariaDB [(none)]> set password for ‘root‘@‘127.0.0.1‘=password(‘magedu‘);
MariaDB [(none)]> flush privileges; 重讀授權表生效
在登錄界面輸入上面的用戶名和密碼即可

Centos7.2之phpadmin安裝配置