MySQL Study之--MySQL下圖形工具的使用(phpMyAdmin),--mysqlphpmyadmin

來源:互聯網
上載者:User

MySQL Study之--MySQL形工具的使用(phpMyAdmin),--mysqlphpmyadmin
MySQL Study之--MySQL形工具的使用(phpMyAdmin)
系統內容:RedHat EL6資料庫:    MySQL 5.6.4-m7
      phpMyAdmin是一個用PHP編寫的軟體工具,是以PHP為基礎,以Web-Base方式架構在網站主機上的MySQL的資料庫管理工具,讓管理者可用Web介面管理MySQL資料庫。藉由此Web介面可以成為一個簡易方式輸入繁雜SQL文法的較佳途徑,尤其要處理大量資料的匯入及匯出更為方便。其中一個更大的優勢在於由於phpMyAdmin跟其他PHP程式一樣在網頁伺服器上執行,但是您可以在任何地方使用這些程式產生的HTML頁面,也就是於遠端管理MySQL資料庫,方便的建立、修改、刪除資料庫及資料表。也可藉由phpMyAdmin建立常用的php文法,方便編寫網頁時所需要的sql文法正確性。
     在Linux環境下安裝和配置phpMyAdmin需要安裝Apache、PHP、MySQL,這些軟體可以通過RPM包方式或原始碼方式安裝,本案例是以RPM方式安裝: 一、準備應用環境,安裝如下軟體: 1、Apache[root@mysrv libraries]# rpm -qa |grep httpd

httpd-tools-2.2.15-26.el6.x86_64httpd-manual-2.2.15-26.el6.noarchhttpd-2.2.15-26.el6.x86_64
<strong>[root@mysrv libraries]# rpm -qa |grep mod</strong>mod_auth_pgsql-2.0.3-10.1.el6.x86_64mod_authz_ldap-0.26-16.el6.x86_64xorg-x11-drv-modesetting-0.5.0-1.el6.x86_64PackageKit-gtk-module-0.5.8-21.el6.x86_64module-init-tools-3.9-21.el6.x86_64mod_auth_kerb-5.4-9.el6.x86_64mod_wsgi-3.2-3.el6.x86_64mod_ssl-2.2.15-26.el6.x86_64mod_dnssd-0.6-2.el6.x86_64mod_perl-2.0.4-10.el6.x86_64mod_auth_mysql-3.0.0-11.el6_0.1.x86_64
2、mysql
[root@mysrv libraries]# rpm -qa |grep mysqlmysql-5.1.66-2.el6_3.x86_64mysql-bench-5.1.66-2.el6_3.x86_64mysql-devel-5.1.66-2.el6_3.x86_64mysql-libs-5.1.66-2.el6_3.x86_64mysql-connector-odbc-5.1.5r1144-7.el6.x86_64qt-mysql-4.6.2-25.el6.x86_64php-mysql-5.3.3-22.el6.x86_64mysql-devel-5.1.66-2.el6_3.i686mysql-libs-5.1.66-2.el6_3.i686mysql-connector-java-5.1.17-6.el6.noarchmysql-server-5.1.66-2.el6_3.x86_64mod_auth_mysql-3.0.0-11.el6_0.1.x86_64mysql-test-5.1.66-2.el6_3.x86_64
3、php
[root@mysrv libraries]# rpm -qa |grep phpphp-pecl-memcache-3.0.5-4.el6.x86_64php-pgsql-5.3.3-22.el6.x86_64php-cli-5.3.3-22.el6.x86_64php-pdo-5.3.3-22.el6.x86_64php-mysql-5.3.3-22.el6.x86_64php-pecl-apc-3.1.9-2.el6.x86_64php-ldap-5.3.3-22.el6.x86_64php-mbstring-5.3.3-46.el6_6.x86_64php-pear-1.9.4-4.el6.noarchphp-xml-5.3.3-22.el6.x86_64php-5.3.3-22.el6.x86_64php-gd-5.3.3-22.el6.x86_64php-soap-5.3.3-22.el6.x86_64php-common-5.3.3-22.el6.x86_64php-odbc-5.3.3-22.el6.x86_64php-xmlrpc-5.3.3-22.el6.x86_64
其中php-mbstring,在RedHat的安裝光碟片中沒有,需要從網上下載後安裝,安裝後需要以下配置: [root@mysrv libraries]# echo ‘extension=mbstring.so' >>/etc/php.ini                  #根據php安裝目錄而定
[root@mysrv libraries]# service httpd restart
以上軟體包安裝完成後,就可以進入phpMyAdmin的安裝和配置了
二、安裝和配置phpMyAdmin 1、下載安裝和配置phpMyAdmin 1)先到 phpMyAdmin的官方站上下載最近的 phpMyAdmin
https://www.phpmyadmin.net/downloads/下載版本:phpMyAdmin-4.4.11-all-languages.tar.gz
2)將軟體包解壓到/var/www/html
# tar zxvf phpMyAdmin-4.4.11-all-languages.tar.gz -C   /var/www/html
3) 修改目錄名為 phpMyAdmin
# mv  phpMyAdmin-4.4.11-all-languages  phpMyAdmin[root@mysrv oracle]# ls -l /var/www/html/
total 8
-rw-r--r--  1 root root   17 Jul 15 14:21 index.php
drwxr-xr-x 10 root root 4096 Jul 14 17:45 phpMyAdmin 4) 配置phpMyAdmin
1、編輯. /libraries/config.default.php檔案
2、尋找 $cfg['Servers'][$i]['host'] = 'localhost'; 如果允許用戶端遠端管理,將“localhost”改為伺服器ip $cfg['Servers'][$i]['host'] = '192.168.8.24';
3、尋找 $cfg['Servers'][$i]['auth_type'] = 'config';
在自己的機子裡調試用config;如果在網路上的空間用cookie,這裡我們既然在前面已經添加了網址,就修改成cookie ,這裡建議使用cookie. $cfg['Servers'][$i]['auth_type'] = 'cookie';
4、尋找 $cfg['Servers'][$i]['user'] = 'root'; // MySQL user(mysql使用者名稱,自己機裡用root;) $cfg['Servers'][$i]['user'] = 'root';
5、尋找 $cfg['Servers'][$i]['password'] = ''; // MySQL password (mysql使用者的密碼,自己的伺服器一般都是mysql使用者root的密碼) $cfg['Servers'][$i]['password'] = 'oracle';
6、尋找 $cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only(你只有一個資料就設定一下;如果你在本機或想架設伺服器,那麼建議留空) $cfg['Servers'][$i]['only_db'] = '';
7、尋找 $cfg['DefaultLang'] = 'zh'; (這裡是選擇語言,zh代表簡體中文的意思,這裡不知道填gbk對否) $cfg['DefaultLang'] = 'en';
8、設定完畢後儲存
      如果出現“設定檔現在需要絕密的短語密碼(blowfish_secret)”那麼請在$cfg['blowfish_secret'] = ' ';的等號裡面設定你網站的cookie,例如:$cfg['blowfish_secret'] = '任一字元';這是因為你的“$cfg['Servers'][$i]['auth_type'] = 'cookie'的原因。
三、測試
開啟瀏覽器,http://192.168.8.24/phpMyAdmin

圖一:登陸介面
圖二:管理介面
----至此,phpMyAdmin已經配置成功!
注意:
以上,錯誤,是因為在linux下沒有安裝和配置php-mbstring造成 !

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.