?? phpmyadmin.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><title>Installing phpMyAdmin</title>
<link rel="stylesheet" href="phpmyadmin_files/home.css" type="text/css">
<link rel="stylesheet" href="phpmyadmin_files/webpub.css" type="text/css">
<style type="text/css">
.highlight { background: #FFFF66 }
td { vertical-align: top;
}
</style></head>
<body bgcolor="#ffffff">
<a href="http://www.washington.edu/"><img id="toplogo" src="phpmyadmin_files/UWlogo150p.gif" alt="University of Washington" border="0"></a>
<div id="toolbar">
<span class="l1text"><a href="http://www.washington.edu/home/search.html">Search</a> |
<a href="http://www.washington.edu/home/directories.html">Directories</a> |
<a href="http://www.lib.washington.edu/research/">Reference
Tools</a></span></div>
<!--Section Banner Table -->
<div class="bannerwrapper">
<div id="topbanner"><img src="phpmyadmin_files/rib0.gif" alt="" height="16" width="6"></div>
</div>
<div id="crumbs"><span class="l1text"><a href="http://www.washington.edu/">UW Home</a> > <a href="http://www.washington.edu/uwin/">UWIN</a> > <a href="http://www.washington.edu/computing/">Computing and Networking</a> > <a href="http://www.washington.edu/computing/web/">Web</a> > <a href="http://www.washington.edu/computing/web/publishing/">Web Publishing</a> > <a href="http://www.washington.edu/computing/web/publishing/mysql.html">Using MySQL</a></span> </div><div class="forceclear"></div>
<table style="table-layout: fixed;" align="right" bgcolor="#ffffcc" border="1" cellpadding="5" cellspacing="0">
<tbody><tr>
<td width="120">
<p>This article applies to the following UW Web servers:</p>
<center>
<a href="http://faculty.washington.edu/">faculty</a><br>
<a href="http://staff.washington.edu/">staff</a><br>
<a href="http://students.washington.edu/">students</a><br>
<a href="http://courses.washington.edu/">courses</a><br>
<a href="http://depts.washington.edu/">depts</a><br>
</center>
</td>
</tr>
</tbody></table>
<h1>Installing phpMyAdmin</h1>
<h4>Summary</h4>
<p><a href="http://www.phpmyadmin.net/">phpMyAdmin</a> is a popular and
free PHP application used for administering one or more <a href="http://www.mysql.com/">MySQL</a> servers.
While C&C does not support MySQL or phpMyAdmin, this article briefly describes phpMyAdmin, outlines the
steps for installing and configuring phpMyAdmin on your UW account, and provides links to additional phpMyAdmin resources.
</p><p>The instructions on this page will show you how to:</p>
<ul>
<li>Download and install the latest version of phpMyAdmin.
</li><li>Configure phpMyAdmin so that it can connect to your MySQL server.
</li><li>Password-protect your copy of phpMyAdmin with your UW NetID.
</li></ul>
<p>Note: You must <a href="http://www.washington.edu/computing/web/publishing/mysql-install.html">install and start your MySQL server</a> before you can use phpMyAdmin. </p>
<h4>About phpMyAdmin</h4>
<p>
phpMyAdmin provides an easy-to-use Web interface for most of the features of MySQL's <a href="http://www.washington.edu/computing/web/publishing/mysql-client.html">command-line client</a>.
With phpMyAdmin you can:
</p><ul>
<li>create and delete databases</li>
<li>create, copy, delete and alter tables</li>
<li>delete, edit and add fields</li>
<li>execute any SQL-statement, including batch-queries</li>
<li>manage keys on fields</li>
<li>load text files into tables</li>
<li>use many other advanced features</li>
</ul>
<!--<p>Tip: Use a shell with tab-completion, such as bash or tcsh, to help you enterthe commands described in this document. Just type <tt>bash</tt> or <tt>tcsh</tt>as your first command after dropping into the <a href="environs.html">Webdevelopment environment</a>.</p>-->
<h4><a name="2">Instructions</a></h4>
<ol>
<li> <p>Log in to your Homer or Dante account with <a href="http://www.washington.edu/computing/software/uwick/teraterm">Tera Term</a>
or another terminal emulator.</p>
</li><li>
<p>Press the O key for Other.</p>
</li><li>
<p>Press the W key to drop into the <a href="http://www.washington.edu/computing/web/publishing/environs.html">Web
development environment</a> and cd into your Web directory:</p>
<p><span class="code">cd public_html</span></p>
<!-- STEP 4 -->
</li><li><p>Download the latest version of phpMyAdmin. Use wget or lynx to download
and save the file to your account depending on what host you're on.</p>
<p>On ovid:<br>
<span class="code">wget
http://washington.edu/computing/web/publishing/phpMyAdmin-2.8.1.tar.gz</span></p>
<p>On vergil:<br>
<span class="code">lynx -dump
http://washington.edu/computing/web/publishing/phpMyAdmin-2.8.1.tar.gz >
phpMyAdmin-2.8.1.tar.gz
</span></p>
<!--<p><ul><li>Press D when prompted with <tt>application/gzip D)ownload, orC)ancel</tt>. This will start the download.<li>Press [enter] to save the file to your account after the download iscomplete.<li>Press Q and [enter] to quit lynx and return to the shell.</ul></p>-->
<!-- STEP 5 -->
</li><li><p>Unzip the file you just downloaded:</p>
<p><span class="code">gunzip -cd phpMyAdmin-2.8.1.tar.gz | tar xvf -</span></p>
<!-- STEP 6 -->
</li><li>
<p>If this is the first time you are installing phpMyAdmin, create a symbolic link to the phpMyAdmin directory:</p>
<p><span class="code">ln -s phpMyAdmin-2.8.1 phpmyadmin</span></p>
<p>If you are <a href="http://www.washington.edu/computing/web/publishing/phpmyadmin-upgrade.html">upgrading an existing version of phpMyAdmin</a>, you may wish to wait to create a symbolic link until you've verified that your new phpMyAdmin installation is working.</p>
<!-- STEP 7 -->
</li><li>
<p>Since phpMyAdmin is typically used with MySQL root priviliges
for administration purposes, you should password-protect the phpMyAdmin directory:</p>
<p></p><table class="code">
<tbody><tr>
<td>cd phpmyadmin<br>
pico .htaccess
</td>
</tr>
</tbody></table>
<p>Enter the following lines to password-protect the phpMyAdmin directory with
your account's UW NetID, replacing <tt><i>accountname</i></tt> with the UW NetID of your account:</p>
<p></p><table class="code">
<tbody><tr>
<td>AuthType UWNetID<br>
require user <i>accountname</i>
</td>
</tr>
</tbody></table>
<p>Press ^X to save the file and exit.</p>
<p><b>Tip:</b> If you're interested in learning more about controlling access to your website, see <a href="https://www.washington.edu/computing/web/publishing/access.html">Controlling Access to Web Pages</a>.</p>
<!-- STEP 8 -->
</li><li>
<p>PhpMyAdmin has a new web-based configuration interface, so we'll be using
that to configure it. Let us know what you think about this if you've used
the old method before.</p>
<p>First create a directory for the script to write the config into:</p>
<p><span class="code">mkdir config</span></p>
<p>Start a Web browser and enter the following URL, replacing <tt>depts.washington.edu/<i>accountname</i></tt> with the
<a href="https://www.washington.edu/computing/web/publishing/urls-web.html">base URL</a> to your Web site:</p>
<p><span class="code">https://depts.washington.edu/<i>accountname</i>/phpmyadmin/scripts/setup.php</span></p>
<p>Click on the "Add" button in the "Servers" section and fill in the
following fields:</p>
<table>
<tbody>
<tr>
<td style="text-align: right;">Server
hostname:</td><td><code>ovid.u.washington.edu</code><br>
This is the host that your MySQL server is running on.
If your Web site is hosted on <tt>students.washington.edu</tt>, use
<tt>vergil</tt> instead of <tt>ovid</tt>.
</td></tr><tr>
<td style="text-align: right;">Server port:</td><td><a href="http://www.washington.edu/computing/web/publishing/mysql-install.html#step9">the port your MySQL server is
configured to use</a></td>
</tr><tr>
<td style="text-align: right;">Password for config auth:</td><td><a href="http://www.washington.edu/computing/web/publishing/mysql-install.html#step11">the root password for your MySQL
server</a></td>
</tr>
</tbody>
</table>
<p>Press the button that says "Add" in green. Then press the "Save" button in
the "Configuration" section.</p>
<p>Now copy the configuration file into the main directory and delete the
config directory:</p>
<p></p><table class="code">
<tbody><tr>
<td>cp config/config.inc.php ./<br>
rm -rf config</td>
</tr>
</tbody></table>
<!--<li><p>Modify the phpMyAdmin configuration file. This file contains many different settingsand allows you to customize your copy of phpMyAdmin:</p><p><span class="code">pico -w config.inc.php</span></p><p>Look for the following highlighted lines:</p><p><table class="code"> <tr> <td><pre>/** * Your phpMyAdmin url * * Complete the variable below with the full url ie * http://www.your_web.net/path_to_your_phpMyAdmin_directory/ * * It must contain characters that are valid for a URL, and the path is * case sensitive on some Web servers, for example Unix-based servers. * * In most cases you can leave this variable empty, as the correct value * will be detected automatically. However, we recommend that you do * test to see that the auto-detection code works in your system. A good * test is to browse a table, then edit a row and save it. There will be * an error message if phpMyAdmin cannot auto-detect the correct value. * * If the auto-detection code does work properly, you can set to TRUE the * $cfg['PmaAbsoluteUri_DisableWarning'] variable below. */<b>1</b><span class="highlight"> $cfg['PmaAbsoluteUri'] = ''; </span>/** * Disable the default warning about $cfg['PmaAbsoluteUri'] not being set * You should use this if and ONLY if the PmaAbsoluteUri auto-detection * works perfectly. */$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;/** * Disable the default warning that is displayed on the DB Details Structure page if * any of the required Tables for the relationfeatures could not be found */$cfg['PmaNoRelation_DisableWarning'] = FALSE;/** * Server(s) configuration */$i = 0;// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].// You can disable a server config entry by setting host to ''.$i++;<b>2</b><span class="highlight"> $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname </span><b>3</b><span class="highlight"> $cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port </span> $cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket') $cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli') $cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection // (requires PHP >= 4.3.0) $cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings // (this user must have read-only $cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user" // and "mysql/db" tables) $cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)? $cfg['Servers'][$i]['user'] = 'root'; // MySQL user<b>4</b><span class="highlight"> $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed </span> // with 'config' auth_type)</pre></td></tr></table></p><p>Edit the highlighted lines accordingly:</p><ol><li><p><span class="code">$cfg['PmaAbsoluteUri'] = 'https://depts.washington.edu/<i>accountname</i>/phpmyadmin/';</span></p><p>Replace <tt>depts.washington.edu/accountname</tt> with the<a href="https://www.washington.edu/computing/web/publishing/urls-web.html">base URL</a> to your Web site.</p><li><p><span class="code">$cfg['Servers'][$i]['host'] = 'ovid.u.washington.edu';</span></p>If your Web site is hosted on <tt>students.washington.edu</tt>, use <tt>vergil</tt> instead of <tt>ovid</tt>.</p><li><p><span class="code">$cfg['Servers'][$i]['port'] = '<i>XXXXX</i>';</span></p><p>Replace <tt><i>XXXXX</i></tt> with <a href="mysql-install.html#step9">the port your MySQL server is configured to use</a>.</p><li><p><span class="code">$cfg['Servers'][$i]['password'] = '<i>mypassword</i>';</span></p><p>Replace <tt><i>mypassword</i></tt> with <a href="mysql-install.html#step11">the root password for your MySQL server</a>.</p></ol><p>Press ^X to save the file and exit.</p>-->
<!-- STEP 9 -->
</li><li>
<p>Assuming your MySQL server is running, you are now ready to connect to it and
administer it with phpMyAdmin.</p>
<p>Start a Web browser and enter the following URL, replacing <tt>depts.washington.edu/<i>accountname</i></tt> with the
<a href="https://www.washington.edu/computing/web/publishing/urls-web.html">base URL</a> to your Web site:</p>
<p><span class="code">https://depts.washington.edu/<i>accountname</i>/phpmyadmin/</span></p>
</li></ol>
<!-- RESOURCES -->
<h4>Resources</h4>
<ul>
<li><a href="http://www.phpmyadmin.net/documentation/">Official phpMyAdmin documentation</a>.
</li></ul>
<div id="footer"><div id="footerseal">
<a href="http://www.washington.edu/"><img src="phpmyadmin_files/footersealW.gif" alt="UW Seal"></a>
</div>
<div id="addressright"><address>
A service provided by<br>
<a href="http://depts.washington.edu/cac/"><img src="phpmyadmin_files/CnC_full_UW_Purple-1.gif" alt="Computing & Communications" border="0" height="14" width="202"></a>
</address>
</div>
<div id="address"><address>
<a href="http://depts.washington.edu/cac/">Computing
& Communications</a><br>
help@cac.washington.edu<br>
Modified: June 6, 2006
</address>
</div>
</div>
<!--Created by chtml on Sep 15, 2006 11:59am--></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -