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

來源:互聯網
上載者:User

標籤:mysql

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

[[email protected] libraries]# rpm -qa |grep httpdhttpd-tools-2.2.15-26.el6.x86_64httpd-manual-2.2.15-26.el6.noarchhttpd-2.2.15-26.el6.x86_64[[email protected] libraries]# rpm -qa |grep modmod_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

[[email protected] 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

[[email protected] 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的安裝光碟片中沒有,需要從網上下載後安裝,安裝後需要以下配置:

[[email protected] libraries]# echo ‘extension=mbstring.so‘ >>/etc/php.ini #根據php安裝目錄而定[[email protected] 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

[[email protected] 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

650) this.width=650;" src="http://img.blog.csdn.net/20150715161941423?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" style="border:none;" />

圖一:登陸介面

650) this.width=650;" src="http://img.blog.csdn.net/20150715162028340?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" style="border:none;" />

圖二:管理介面

----至此,phpMyAdmin已經配置成功!


注意:

650) this.width=650;" src="http://img.blog.csdn.net/20150715162349053?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" style="border:none;" />

以上,錯誤,是因為在linux下沒有安裝和配置php-mbstring造成 !




本文出自 “天涯客的blog” 部落格,請務必保留此出處http://tiany.blog.51cto.com/513694/1674979

MySQL Study之--MySQL形工具的使用(phpMyAdmin)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.