溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么啟動yum安裝phpmyadmin

發(fā)布時(shí)間:2020-12-21 09:36:40 來源:億速云 閱讀:190 作者:小新 欄目:數(shù)據(jù)庫

這篇文章將為大家詳細(xì)講解有關(guān)怎么啟動yum安裝phpmyadmin,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

在安裝好Apache、MySQL、PHP后,使用Remi源可以安裝phpMyAdmin最新版本。

(1)安裝Remi源

CentOS 6.5的epel及remi源。

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

CentOS 7.0的源。

# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

(2)安裝phpMyAdmin

# yuminstall--enablerepo=remi--enablerepo=remi-php56phpmyadmin

(3)配置phpMyAdmin

a.修改/etc/phpMyAdmin/config.inc.php:

打開config.inc.php文件,進(jìn)行以下修改:

// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
去掉每行前面的//
$cfg['blowfish_secret'] = '';修改為$cfg['blowfish_secret'] = 'config';
$cfg['Servers'][$i]['controluser'] ='pma';把pma修改為你的帳號
$cfg['Servers'][$i]['controlpass'] ='pmapass';把pmapass設(shè)置為你的mysql登錄密碼
$cfg['blowfish_secret'] ='';添加短語密碼,可是任意字符串例如:$cfg['blowfish_secret'] = 'abcd'修改以后,
以后登入phpMyAdmin就方便多了,但一定不要使用空密碼。

b.修改/etc/httpd/conf.d/phpMyAdmin.conf

本文件是phpMyAdmin的訪問控制文件,保證遠(yuǎn)程訪問。如下修改即可:

<Directory /usr/share/phpMyAdmin/>
OrderDeny,Allow
#Deny  from All
Allow from All
</Directory>

(4)用命令/etc/init.d/httpd restart重啟Apache,測試:訪問http://ip地址/phpMyAdmin/

可能會出現(xiàn)以下問題:

1.如果安裝php時(shí)沒有安裝php-mcrypt包,可能會出現(xiàn)錯(cuò)誤提示,這時(shí)只需將其安裝:

yum -y install php-mcrypt

2.phpMyAdmin訪問被拒絕

將config.inc文件中$cfg['Servers'][$i]['auth_type'] = 'config';的config改為http,重啟Apache,訪問http://ip地址/phpMyAdmin/時(shí)將彈出一個(gè)對話框,可以輸入用戶名和密碼,來進(jìn)入phpMyAdmin。

3.如果經(jīng)過以上兩個(gè)步驟的修改,依然提示你phpMyAdmin拒絕訪問,那么很可能是cookie惹的禍,打開瀏覽器,選擇工具,點(diǎn)擊internet選項(xiàng)然后選擇常規(guī),刪除cookie。再訪問http://ip地址/phpMyAdmin/。

(5)成功登錄phpMyAdmin后,若提示”Configuration of pmadb…錯(cuò)誤”,則進(jìn)行以下操作:

a.命令行登錄mysql:

mysql -uroot -p

b.新建一個(gè)名稱為phpmyadmin的數(shù)據(jù)庫:

CREATE DATABASE phpmyadmin

c.將PHPMyAdmin安裝目錄下sql目錄內(nèi)的create_tables.sql導(dǎo)入剛剛創(chuàng)建的數(shù)據(jù)庫phpmyadmin內(nèi):

use phpmyadmin
source /usr/share/phpMyAdmin/sql/create_tables.sql

d.訪問phpMyAdmin,如果還是不行,重啟Apache后再試試。

關(guān)于怎么啟動yum安裝phpmyadmin就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI