Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / doc / html / setup.html
blobaec2ae1696163d8787e362d1cb48fef1ff87e6e3
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7 <html xmlns="http://www.w3.org/1999/xhtml">
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11 <title>Installation &mdash; phpMyAdmin 4.0.4 documentation</title>
13 <link rel="stylesheet" href="_static/default.css" type="text/css" />
14 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16 <script type="text/javascript">
17 var DOCUMENTATION_OPTIONS = {
18 URL_ROOT: '',
19 VERSION: '4.0.4',
20 COLLAPSE_INDEX: false,
21 FILE_SUFFIX: '.html',
22 HAS_SOURCE: true
24 </script>
25 <script type="text/javascript" src="_static/jquery.js"></script>
26 <script type="text/javascript" src="_static/underscore.js"></script>
27 <script type="text/javascript" src="_static/doctools.js"></script>
28 <link rel="copyright" title="Copyright" href="copyright.html" />
29 <link rel="top" title="phpMyAdmin 4.0.4 documentation" href="index.html" />
30 <link rel="next" title="Configuration" href="config.html" />
31 <link rel="prev" title="Requirements" href="require.html" />
32 </head>
33 <body>
34 <div class="related">
35 <h3>Navigation</h3>
36 <ul>
37 <li class="right" style="margin-right: 10px">
38 <a href="genindex.html" title="General Index"
39 accesskey="I">index</a></li>
40 <li class="right" >
41 <a href="config.html" title="Configuration"
42 accesskey="N">next</a> |</li>
43 <li class="right" >
44 <a href="require.html" title="Requirements"
45 accesskey="P">previous</a> |</li>
46 <li><a href="index.html">phpMyAdmin 4.0.4 documentation</a> &raquo;</li>
47 </ul>
48 </div>
50 <div class="document">
51 <div class="documentwrapper">
52 <div class="bodywrapper">
53 <div class="body">
55 <div class="section" id="installation">
56 <span id="setup"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h1>
57 <p>phpMyAdmin does not apply any special security methods to the MySQL
58 database server. It is still the system administrator&#8217;s job to grant
59 permissions on the MySQL databases properly. phpMyAdmin&#8217;s <em class="guilabel">Users</em>
60 page can be used for this.</p>
61 <div class="admonition warning">
62 <p class="first admonition-title">Warning</p>
63 <p class="last"><a class="reference internal" href="glossary.html#term-mac"><em class="xref std std-term">Mac</em></a> users should note that if you are on a version before
64 <a class="reference internal" href="glossary.html#term-mac-os-x"><em class="xref std std-term">Mac OS X</em></a>, StuffIt unstuffs with <a class="reference internal" href="glossary.html#term-mac"><em class="xref std std-term">Mac</em></a> formats. So you&#8217;ll have
65 to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before
66 uploading them to your server, as PHP seems not to like <a class="reference internal" href="glossary.html#term-mac"><em class="xref std std-term">Mac</em></a>-style
67 end of lines character (&#8220;<tt class="docutils literal"><span class="pre">\r</span></tt>&#8221;).</p>
68 </div>
69 <div class="section" id="quick-install">
70 <span id="id1"></span><h2>Quick Install<a class="headerlink" href="#quick-install" title="Permalink to this headline"></a></h2>
71 <ol class="arabic simple">
72 <li>Choose an appropriate distribution kit from the phpmyadmin.net
73 Downloads page. Some kits contain only the English messages, others
74 contain all languages. We&#8217;ll assume you chose a kit whose name
75 looks like <tt class="docutils literal"><span class="pre">phpMyAdmin-x.x.x</span> <span class="pre">-all-languages.tar.gz</span></tt>.</li>
76 <li>Untar or unzip the distribution (be sure to unzip the subdirectories):
77 <tt class="docutils literal"><span class="pre">tar</span> <span class="pre">-xzvf</span> <span class="pre">phpMyAdmin_x.x.x-all-languages.tar.gz</span></tt> in your
78 webserver&#8217;s document root. If you don&#8217;t have direct access to your
79 document root, put the files in a directory on your local machine,
80 and, after step 4, transfer the directory on your web server using,
81 for example, ftp.</li>
82 <li>Ensure that all the scripts have the appropriate owner (if PHP is
83 running in safe mode, having some scripts with an owner different from
84 the owner of other scripts will be a problem). See <a class="reference internal" href="faq.html#faq4-2"><em>4.2 What&#8217;s the preferred way of making phpMyAdmin secure against evil access?</em></a> and
85 <a class="reference internal" href="faq.html#faq1-26"><em>1.26 I just installed phpMyAdmin in my document root of IIS but I get the error &#8220;No input file specified&#8221; when trying to run phpMyAdmin.</em></a> for suggestions.</li>
86 <li>Now you must configure your installation. There are two methods that
87 can be used. Traditionally, users have hand-edited a copy of
88 <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>, but now a wizard-style setup script is provided
89 for those who prefer a graphical installation. Creating a
90 <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> is still a quick way to get started and needed for
91 some advanced features.</li>
92 </ol>
93 <div class="section" id="manualy-creating-file">
94 <h3>Manualy creating file<a class="headerlink" href="#manualy-creating-file" title="Permalink to this headline"></a></h3>
95 <p>To manually create the file, simply use your text editor to create the
96 file <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> (you can copy <tt class="file docutils literal"><span class="pre">config.sample.inc.php</span></tt> to get
97 minimal configuration file) in the main (top-level) phpMyAdmin
98 directory (the one that contains <tt class="file docutils literal"><span class="pre">index.php</span></tt>). phpMyAdmin first
99 loads <tt class="file docutils literal"><span class="pre">libraries/config.default.php</span></tt> and then overrides those values
100 with anything found in <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>. If the default value is
101 okay for a particular setting, there is no need to include it in
102 <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>. You&#8217;ll need a few directives to get going, a
103 simple configuration may look like this:</p>
104 <div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>
105 <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;blowfish_secret&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;ba17c1ec07d65003&#39;</span><span class="p">;</span> <span class="c1">// use here a value of your choice</span>
107 <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
108 <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
109 <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;auth_type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;cookie&#39;</span><span class="p">;</span>
110 <span class="cp">?&gt;</span><span class="x"></span>
111 </pre></div>
112 </div>
113 <p>Or, if you prefer to not be prompted every time you log in:</p>
114 <div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>
116 <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
117 <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
118 <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;root&#39;</span><span class="p">;</span>
119 <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;cbb74bc&#39;</span><span class="p">;</span> <span class="c1">// use here your password</span>
120 <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;auth_type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;config&#39;</span><span class="p">;</span>
121 <span class="cp">?&gt;</span><span class="x"></span>
122 </pre></div>
123 </div>
124 <p>For a full explanation of possible configuration values, see the
125 <a class="reference internal" href="config.html#config"><em>Configuration</em></a> of this document.</p>
126 </div>
127 <div class="section" id="using-setup-script">
128 <span id="setup-script"></span><span id="index-0"></span><h3>Using Setup script<a class="headerlink" href="#using-setup-script" title="Permalink to this headline"></a></h3>
129 <p>Instead of manually editing <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>, you can use the <a class="reference external" href="setup/">Setup
130 Script</a>. First you must manually create a folder <tt class="docutils literal"><span class="pre">config</span></tt>
131 in the phpMyAdmin directory. This is a security measure. On a
132 Linux/Unix system you can use the following commands:</p>
133 <div class="highlight-sh"><div class="highlight"><pre><span class="nb">cd </span>phpMyAdmin
134 mkdir config <span class="c"># create directory for saving</span>
135 chmod o+rw config <span class="c"># give it world writable permissions</span>
136 </pre></div>
137 </div>
138 <p>And to edit an existing configuration, copy it over first:</p>
139 <div class="highlight-sh"><div class="highlight"><pre>cp config.inc.php config/ <span class="c"># copy current configuration for editing</span>
140 chmod o+w config/config.inc.php <span class="c"># give it world writable permissions</span>
141 </pre></div>
142 </div>
143 <p>On other platforms, simply create the folder and ensure that your web
144 server has read and write access to it. <a class="reference internal" href="faq.html#faq1-26"><em>1.26 I just installed phpMyAdmin in my document root of IIS but I get the error &#8220;No input file specified&#8221; when trying to run phpMyAdmin.</em></a> can help with
145 this.</p>
146 <p>Next, open <tt class="docutils literal"><span class="pre">setup/</span></tt> in your browser. Note that <strong>changes are
147 not saved to disk until explicitly choose ``Save``</strong> from the
148 <em>Configuration</em> area of the screen. Normally the script saves the new
149 <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> to the <tt class="docutils literal"><span class="pre">config/</span></tt> directory, but if the webserver does
150 not have the proper permissions you may see the error &#8220;Cannot load or
151 save configuration.&#8221; Ensure that the <tt class="docutils literal"><span class="pre">config/</span></tt> directory exists and
152 has the proper permissions - or use the <tt class="docutils literal"><span class="pre">Download</span></tt> link to save the
153 config file locally and upload (via FTP or some similar means) to the
154 proper location.</p>
155 <p>Once the file has been saved, it must be moved out of the <tt class="docutils literal"><span class="pre">config/</span></tt>
156 directory and the permissions must be reset, again as a security
157 measure:</p>
158 <div class="highlight-sh"><div class="highlight"><pre>mv config/config.inc.php . <span class="c"># move file to current directory</span>
159 chmod o-rw config.inc.php <span class="c"># remove world read and write permissions</span>
160 rm -rf config <span class="c"># remove not needed directory</span>
161 </pre></div>
162 </div>
163 <p>Now the file is ready to be used. You can choose to review or edit the
164 file with your favorite editor, if you prefer to set some advanced
165 options which the setup script does not provide.</p>
166 <ol class="arabic simple">
167 <li>If you are using the <tt class="docutils literal"><span class="pre">auth_type</span></tt> &#8220;config&#8221;, it is suggested that you
168 protect the phpMyAdmin installation directory because using config
169 does not require a user to enter a password to access the phpMyAdmin
170 installation. Use of an alternate authentication method is
171 recommended, for example with HTTP–AUTH in a <a class="reference internal" href="glossary.html#term-htaccess"><em class="xref std std-term">.htaccess</em></a> file or switch to using
172 <tt class="docutils literal"><span class="pre">auth_type</span></tt> cookie or http. See the <a class="reference internal" href="faq.html#faqmultiuser"><em>ISPs, multi-user installations</em></a>
173 for additional information, especially <a class="reference internal" href="faq.html#faq4-4"><em>4.4 phpMyAdmin always gives &#8220;Access denied&#8221; when using HTTP authentication.</em></a>.</li>
174 <li>Open the <a class="reference external" href="index.php">main phpMyAdmin directory</a> in your browser.
175 phpMyAdmin should now display a welcome screen and your databases, or
176 a login dialog if using <a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a> or
177 cookie authentication mode.</li>
178 <li>You should deny access to the <tt class="docutils literal"><span class="pre">./libraries</span></tt> and <tt class="docutils literal"><span class="pre">./setup/lib</span></tt>
179 subfolders in your webserver configuration. For Apache you can use
180 supplied <a class="reference internal" href="glossary.html#term-htaccess"><em class="xref std std-term">.htaccess</em></a> file in that folder, for other webservers, you should
181 configure this yourself. Such configuration prevents from possible
182 path exposure and cross side scripting vulnerabilities that might
183 happen to be found in that code.</li>
184 <li>It is generally good idea to protect public phpMyAdmin installation
185 against access by robots as they usually can not do anything good
186 there. You can do this using <tt class="docutils literal"><span class="pre">robots.txt</span></tt> file in root of your
187 webserver or limit access by web server configuration, see
188 <a class="reference internal" href="faq.html#faq1-42"><em>1.42 How can I prevent robots from accessing phpMyAdmin?</em></a>.</li>
189 </ol>
190 </div>
191 </div>
192 <div class="section" id="phpmyadmin-configuration-storage">
193 <span id="linked-tables"></span><span id="index-1"></span><h2>phpMyAdmin configuration storage<a class="headerlink" href="#phpmyadmin-configuration-storage" title="Permalink to this headline"></a></h2>
194 <p>For a whole set of new features (bookmarks, comments, <a class="reference internal" href="glossary.html#term-sql"><em class="xref std std-term">SQL</em></a>-history,
195 tracking mechanism, <a class="reference internal" href="glossary.html#term-pdf"><em class="xref std std-term">PDF</em></a>-generation, column contents transformation,
196 etc.) you need to create a set of special tables. Those tables can be located
197 in your own database, or in a central database for a multi-user installation
198 (this database would then be accessed by the controluser, so no other user
199 should have rights to it).</p>
200 <p>Please look at your <tt class="docutils literal"><span class="pre">./examples/</span></tt> directory, where you should find a
201 file called <em>create_tables.sql</em>. (If you are using a Windows server,
202 pay special attention to <a class="reference internal" href="faq.html#faq1-23"><em>1.23 I&#8217;m running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!</em></a>).</p>
203 <p>If you already had this infrastructure and upgraded to MySQL 4.1.2 or
204 newer, please use <tt class="file docutils literal"><span class="pre">examples/upgrade_tables_mysql_4_1_2+.sql</span></tt>
205 and then create new tables by importing
206 <tt class="file docutils literal"><span class="pre">examples/create_tables.sql</span></tt>.</p>
207 <p>You can use your phpMyAdmin to create the tables for you. Please be
208 aware that you may need special (administrator) privileges to create
209 the database and tables, and that the script may need some tuning,
210 depending on the database name.</p>
211 <p>After having imported the <tt class="file docutils literal"><span class="pre">examples/create_tables.sql</span></tt> file, you
212 should specify the table names in your <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> file. The
213 directives used for that can be found in the <a class="reference internal" href="config.html#config"><em>Configuration</em></a>. You will also need to
214 have a controluser with the proper rights to those tables (see section
215 <a class="reference internal" href="#authentication-modes"><em>Using authentication modes</em></a> below).</p>
216 </div>
217 <div class="section" id="upgrading-from-an-older-version">
218 <span id="upgrading"></span><h2>Upgrading from an older version<a class="headerlink" href="#upgrading-from-an-older-version" title="Permalink to this headline"></a></h2>
219 <p>Simply copy <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> from your previous installation into
220 the newly unpacked one. Configuration files from old versions may
221 require some tweaking as some options have been changed or removed.
222 For compatibility with PHP 6, remove a
223 <tt class="docutils literal"><span class="pre">set_magic_quotes_runtime(0);</span></tt> statement that you might find near
224 the end of your configuration file.</p>
225 <p>You should <strong>not</strong> copy <tt class="file docutils literal"><span class="pre">libraries/config.default.php</span></tt> over
226 <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt> because the default configuration file is version-
227 specific.</p>
228 <p>If you have upgraded your MySQL server from a version previous to 4.1.2 to
229 version 5.x or newer and if you use the phpMyAdmin configuration storage, you
230 should run the <a class="reference internal" href="glossary.html#term-sql"><em class="xref std std-term">SQL</em></a> script found in
231 <tt class="file docutils literal"><span class="pre">examples/upgrade_tables_mysql_4_1_2+.sql</span></tt>.</p>
232 </div>
233 <div class="section" id="using-authentication-modes">
234 <span id="authentication-modes"></span><span id="index-2"></span><h2>Using authentication modes<a class="headerlink" href="#using-authentication-modes" title="Permalink to this headline"></a></h2>
235 <p><a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a> and cookie authentication modes are recommended in a <strong>multi-user
236 environment</strong> where you want to give users access to their own database and
237 don&#8217;t want them to play around with others. Nevertheless be aware that MS
238 Internet Explorer seems to be really buggy about cookies, at least till version
239 6. Even in a <strong>single-user environment</strong>, you might prefer to use <a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a>
240 or cookie mode so that your user/password pair are not in clear in the
241 configuration file.</p>
242 <p><a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a> and cookie authentication
243 modes are more secure: the MySQL login information does not need to be
244 set in the phpMyAdmin configuration file (except possibly for the
245 <span class="target" id="index-3"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controluser']</span></tt></a>).
246 However, keep in mind that the password travels in plain text, unless
247 you are using the HTTPS protocol. In cookie mode, the password is
248 stored, encrypted with the blowfish algorithm, in a temporary cookie.</p>
249 <p>For &#8216;<a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a>&#8216; and &#8216;cookie&#8217; modes, phpMyAdmin needs a controluser that has
250 <strong>only</strong> the <tt class="docutils literal"><span class="pre">SELECT</span></tt> privilege on the <em>`mysql`.`user` (all columns except
251 `Password`)</em>, <em>`mysql`.`db` (all columns)</em>, <em>`mysql`.`host` (all columns)</em> and
252 <em>`mysql`.`tables_priv` (all columns except `Grantor` and `Timestamp`)</em> tables.
253 You must specify the details for the controluser in the <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>
254 file under the <span class="target" id="index-4"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controluser']</span></tt></a> and
255 <span class="target" id="index-5"></span><a class="reference internal" href="config.html#cfg_Servers_controlpass"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controlpass']</span></tt></a> settings. The following
256 example assumes you want to use <tt class="docutils literal"><span class="pre">pma</span></tt> as the controluser and <tt class="docutils literal"><span class="pre">pmapass</span></tt> as
257 the controlpass, but <strong>this is only an example: use something else in your
258 file!</strong> Input these statements from the phpMyAdmin <a class="reference internal" href="glossary.html#term-sql"><em class="xref std std-term">SQL</em></a> Query window or
259 mysql command–line client. Of course you have to replace <tt class="docutils literal"><span class="pre">localhost</span></tt> with the
260 webserver&#8217;s host if it&#8217;s not the same as the MySQL server&#8217;s one.</p>
261 <p>If you want to use the many new relation and bookmark features: (this of
262 course requires that your <a class="reference internal" href="#linked-tables"><em>phpMyAdmin configuration storage</em></a> be set up).</p>
263 <div class="highlight-mysql"><div class="highlight"><pre><span class="k">GRANT</span> <span class="k">USAGE</span> <span class="k">ON</span> <span class="n">mysql</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;pmapass&#39;</span><span class="p">;</span>
264 <span class="k">GRANT</span> <span class="k">SELECT</span> <span class="p">(</span>
265 <span class="n">Host</span><span class="p">,</span> <span class="n">User</span><span class="p">,</span> <span class="n">Select_priv</span><span class="p">,</span> <span class="n">Insert_priv</span><span class="p">,</span> <span class="n">Update_priv</span><span class="p">,</span> <span class="n">Delete_priv</span><span class="p">,</span>
266 <span class="n">Create_priv</span><span class="p">,</span> <span class="n">Drop_priv</span><span class="p">,</span> <span class="n">Reload_priv</span><span class="p">,</span> <span class="n">Shutdown_priv</span><span class="p">,</span> <span class="n">Process_priv</span><span class="p">,</span>
267 <span class="n">File_priv</span><span class="p">,</span> <span class="n">Grant_priv</span><span class="p">,</span> <span class="n">References_priv</span><span class="p">,</span> <span class="n">Index_priv</span><span class="p">,</span> <span class="n">Alter_priv</span><span class="p">,</span>
268 <span class="n">Show_db_priv</span><span class="p">,</span> <span class="n">Super_priv</span><span class="p">,</span> <span class="n">Create_tmp_table_priv</span><span class="p">,</span> <span class="n">Lock_tables_priv</span><span class="p">,</span>
269 <span class="n">Execute_priv</span><span class="p">,</span> <span class="n">Repl_slave_priv</span><span class="p">,</span> <span class="n">Repl_client_priv</span>
270 <span class="p">)</span> <span class="k">ON</span> <span class="n">mysql</span><span class="p">.</span><span class="n">user</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span><span class="p">;</span>
271 <span class="k">GRANT</span> <span class="k">SELECT</span> <span class="k">ON</span> <span class="n">mysql</span><span class="p">.</span><span class="n">db</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span><span class="p">;</span>
272 <span class="k">GRANT</span> <span class="k">SELECT</span> <span class="k">ON</span> <span class="n">mysql</span><span class="p">.</span><span class="n">host</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span><span class="p">;</span>
273 <span class="k">GRANT</span> <span class="k">SELECT</span> <span class="p">(</span><span class="n">Host</span><span class="p">,</span> <span class="n">Db</span><span class="p">,</span> <span class="n">User</span><span class="p">,</span> <span class="n">Table_name</span><span class="p">,</span> <span class="n">Table_priv</span><span class="p">,</span> <span class="n">Column_priv</span><span class="p">)</span>
274 <span class="k">ON</span> <span class="n">mysql</span><span class="p">.</span><span class="n">tables_priv</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span><span class="p">;</span>
275 </pre></div>
276 </div>
277 <p>If you want to use the many new relation and bookmark features:</p>
278 <div class="highlight-mysql"><div class="highlight"><pre><span class="k">GRANT</span> <span class="k">SELECT</span><span class="p">,</span> <span class="k">INSERT</span><span class="p">,</span> <span class="k">UPDATE</span><span class="p">,</span> <span class="k">DELETE</span> <span class="k">ON</span> <span class="o">&lt;</span><span class="n">pma_db</span><span class="o">&gt;</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span><span class="p">;</span>
279 </pre></div>
280 </div>
281 <p>(this of course requires that your phpMyAdmin
282 configuration storage be set up).</p>
283 <p>Then each of the <em>true</em> users should be granted a set of privileges
284 on a set of particular databases. Normally you shouldn&#8217;t give global
285 privileges to an ordinary user, unless you understand the impact of those
286 privileges (for example, you are creating a superuser).
287 For example, to grant the user <em>real_user</em> with all privileges on
288 the database <em>user_base</em>:</p>
289 <div class="highlight-mysql"><div class="highlight"><pre><span class="k">GRANT</span> <span class="k">ALL</span> <span class="n">PRIVILEGES</span> <span class="k">ON</span> <span class="n">user_base</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="s1">&#39;real_user&#39;</span><span class="o">@</span><span class="n">localhost</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;real_password&#39;</span><span class="p">;</span>
290 </pre></div>
291 </div>
292 <p>What the user may now do is controlled entirely by the MySQL user management
293 system. With HTTP or cookie authentication mode, you don&#8217;t need to fill the
294 user/password fields inside the <span class="target" id="index-6"></span><a class="reference internal" href="config.html#cfg_Servers"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers']</span></tt></a>.</p>
295 <div class="section" id="http-authentication-mode">
296 <span id="index-7"></span><h3>HTTP authentication mode<a class="headerlink" href="#http-authentication-mode" title="Permalink to this headline"></a></h3>
297 <ul class="simple">
298 <li>Uses <a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a> Basic authentication
299 method and allows you to log in as any valid MySQL user.</li>
300 <li>Is supported with most PHP configurations. For <a class="reference internal" href="glossary.html#term-iis"><em class="xref std std-term">IIS</em></a> (<a class="reference internal" href="glossary.html#term-isapi"><em class="xref std std-term">ISAPI</em></a>)
301 support using <a class="reference internal" href="glossary.html#term-cgi"><em class="xref std std-term">CGI</em></a> PHP see <a class="reference internal" href="faq.html#faq1-32"><em>1.32 Can I use HTTP authentication with IIS?</em></a>, for using with Apache
302 <a class="reference internal" href="glossary.html#term-cgi"><em class="xref std std-term">CGI</em></a> see <a class="reference internal" href="faq.html#faq1-35"><em>1.35 Can I use HTTP authentication with Apache CGI?</em></a>.</li>
303 <li>See also <a class="reference internal" href="faq.html#faq4-4"><em>4.4 phpMyAdmin always gives &#8220;Access denied&#8221; when using HTTP authentication.</em></a> about not using the <a class="reference internal" href="glossary.html#term-htaccess"><em class="xref std std-term">.htaccess</em></a> mechanism along with
304 &#8216;<a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a>&#8216; authentication mode.</li>
305 </ul>
306 </div>
307 <div class="section" id="cookie-authentication-mode">
308 <span id="cookie"></span><span id="index-8"></span><h3>Cookie authentication mode<a class="headerlink" href="#cookie-authentication-mode" title="Permalink to this headline"></a></h3>
309 <ul class="simple">
310 <li>You can use this method as a replacement for the <a class="reference internal" href="glossary.html#term-http"><em class="xref std std-term">HTTP</em></a> authentication
311 (for example, if you&#8217;re running <a class="reference internal" href="glossary.html#term-iis"><em class="xref std std-term">IIS</em></a>).</li>
312 <li>Obviously, the user must enable cookies in the browser, but this is
313 now a requirement for all authentication modes.</li>
314 <li>With this mode, the user can truly log out of phpMyAdmin and log in
315 back with the same username.</li>
316 <li>If you want to log in to arbitrary server see <span class="target" id="index-9"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['AllowArbitraryServer']</span></tt></a> directive.</li>
317 <li>As mentioned in the <a class="reference internal" href="require.html#require"><em>Requirements</em></a> section, having the <tt class="docutils literal"><span class="pre">mcrypt</span></tt> extension will
318 speed up access considerably, but is not required.</li>
319 </ul>
320 </div>
321 <div class="section" id="signon-authentication-mode">
322 <span id="index-10"></span><h3>Signon authentication mode<a class="headerlink" href="#signon-authentication-mode" title="Permalink to this headline"></a></h3>
323 <ul class="simple">
324 <li>This mode is a convenient way of using credentials from another
325 application to authenticate to phpMyAdmin.</li>
326 <li>The other application has to store login information into session
327 data.</li>
328 </ul>
329 <div class="admonition-see-also admonition seealso">
330 <p class="first admonition-title">See also</p>
331 <p class="last"><span class="target" id="index-11"></span><a class="reference internal" href="config.html#cfg_Servers_auth_type"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['auth_type']</span></tt></a>,
332 <span class="target" id="index-12"></span><a class="reference internal" href="config.html#cfg_Servers_SignonSession"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonSession']</span></tt></a>,
333 <span class="target" id="index-13"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></tt></a>,
334 <span class="target" id="index-14"></span><a class="reference internal" href="config.html#cfg_Servers_SignonURL"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonURL']</span></tt></a></p>
335 </div>
336 </div>
337 <div class="section" id="config-authentication-mode">
338 <span id="index-15"></span><h3>Config authentication mode<a class="headerlink" href="#config-authentication-mode" title="Permalink to this headline"></a></h3>
339 <ul class="simple">
340 <li>This mode is the less secure one because it requires you to fill the
341 <span class="target" id="index-16"></span><a class="reference internal" href="config.html#cfg_Servers_user"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['user']</span></tt></a> and
342 <span class="target" id="index-17"></span><a class="reference internal" href="config.html#cfg_Servers_password"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['password']</span></tt></a>
343 fields (and as a result, anyone who can read your <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>
344 can discover your username and password). But you don&#8217;t need to setup
345 a &#8220;controluser&#8221; here: using the <span class="target" id="index-18"></span><a class="reference internal" href="config.html#cfg_Servers_only_db"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['only_db']</span></tt></a> might be enough.</li>
346 <li>In the <a class="reference internal" href="faq.html#faqmultiuser"><em>ISPs, multi-user installations</em></a> section, there is an entry explaining how
347 to protect your configuration file.</li>
348 <li>For additional security in this mode, you may wish to consider the
349 Host authentication <span class="target" id="index-19"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_order"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['order']</span></tt></a>
350 and <span class="target" id="index-20"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></tt></a> configuration directives.</li>
351 <li>Unlike cookie and http, does not require a user to log in when first
352 loading the phpMyAdmin site. This is by design but could allow any
353 user to access your installation. Use of some restriction method is
354 suggested, perhaps a <a class="reference internal" href="glossary.html#term-htaccess"><em class="xref std std-term">.htaccess</em></a> file with the HTTP-AUTH directive or disallowing
355 incoming HTTP requests at one’s router or firewall will suffice (both
356 of which are beyond the scope of this manual but easily searchable
357 with Google).</li>
358 </ul>
359 </div>
360 <div class="section" id="swekey-authentication-mode">
361 <span id="swekey"></span><span id="index-21"></span><h3>Swekey authentication mode<a class="headerlink" href="#swekey-authentication-mode" title="Permalink to this headline"></a></h3>
362 <p>The Swekey is a low cost authentication USB key that can be used in
363 web applications. When Swekey authentication is activated, phpMyAdmin
364 requires the users&#8217;s Swekey to be plugged before entering the login
365 page (currently supported for cookie authentication mode only). Swekey
366 Authentication is disabled by default. To enable it, add the following
367 line to <tt class="file docutils literal"><span class="pre">config.inc.php</span></tt>:</p>
368 <div class="highlight-php"><div class="highlight"><pre><span class="x">$cfg[&#39;Servers&#39;][$i][&#39;auth_swekey_config&#39;] = &#39;/etc/swekey.conf&#39;;</span>
369 </pre></div>
370 </div>
371 <p>You then have to create the <tt class="docutils literal"><span class="pre">swekey.conf</span></tt> file that will associate
372 each user with their Swekey Id. It is important to place this file
373 outside of your web server&#8217;s document root (in the example, it is
374 located in <tt class="docutils literal"><span class="pre">/etc</span></tt>). A self documented sample file is provided in the
375 <tt class="docutils literal"><span class="pre">examples</span></tt> directory. Feel free to use it with your own users&#8217;
376 information. If you want to purchase a Swekey please visit
377 <a class="reference external" href="http://phpmyadmin.net/auth_key">http://phpmyadmin.net/auth_key</a>
378 since this link provides funding for phpMyAdmin.</p>
379 <div class="admonition-see-also admonition seealso">
380 <p class="first admonition-title">See also</p>
381 <p class="last"><span class="target" id="index-22"></span><a class="reference internal" href="config.html#cfg_Servers_auth_swekey_config"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['auth_swekey_config']</span></tt></a></p>
382 </div>
383 </div>
384 </div>
385 <div class="section" id="securing-your-phpmyadmin-installation">
386 <h2>Securing your phpMyAdmin installation<a class="headerlink" href="#securing-your-phpmyadmin-installation" title="Permalink to this headline"></a></h2>
387 <p>The phpMyAdmin team tries hardly to make the application secure, however there
388 are always ways to make your installation more secure:</p>
389 <ul class="simple">
390 <li>remove <tt class="docutils literal"><span class="pre">setup</span></tt> directory from phpMyAdmin, you will probably not
391 use it after initial setup</li>
392 <li>prevent access to <tt class="docutils literal"><span class="pre">libraries</span></tt> directory from browser,
393 as it is not needed, supplied <tt class="docutils literal"><span class="pre">.htaccess</span></tt> file does this</li>
394 <li>properly choose authentication method - <a class="reference internal" href="#cookie"><em>Cookie authentication mode</em></a>
395 is probably the best choice for shared hosting</li>
396 <li>in case you don&#8217;t want all MySQL users to be able to access
397 phpMyAdmin, you can use <span class="target" id="index-23"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><tt class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></tt></a> to limit them</li>
398 <li>consider hiding phpMyAdmin behind authentication proxy, so that
399 MySQL credentials are not all users need to login</li>
400 </ul>
401 </div>
402 </div>
405 </div>
406 </div>
407 </div>
408 <div class="sphinxsidebar">
409 <div class="sphinxsidebarwrapper">
410 <h3><a href="index.html">Table Of Contents</a></h3>
411 <ul>
412 <li><a class="reference internal" href="#">Installation</a><ul>
413 <li><a class="reference internal" href="#quick-install">Quick Install</a><ul>
414 <li><a class="reference internal" href="#manualy-creating-file">Manualy creating file</a></li>
415 <li><a class="reference internal" href="#using-setup-script">Using Setup script</a></li>
416 </ul>
417 </li>
418 <li><a class="reference internal" href="#phpmyadmin-configuration-storage">phpMyAdmin configuration storage</a></li>
419 <li><a class="reference internal" href="#upgrading-from-an-older-version">Upgrading from an older version</a></li>
420 <li><a class="reference internal" href="#using-authentication-modes">Using authentication modes</a><ul>
421 <li><a class="reference internal" href="#http-authentication-mode">HTTP authentication mode</a></li>
422 <li><a class="reference internal" href="#cookie-authentication-mode">Cookie authentication mode</a></li>
423 <li><a class="reference internal" href="#signon-authentication-mode">Signon authentication mode</a></li>
424 <li><a class="reference internal" href="#config-authentication-mode">Config authentication mode</a></li>
425 <li><a class="reference internal" href="#swekey-authentication-mode">Swekey authentication mode</a></li>
426 </ul>
427 </li>
428 <li><a class="reference internal" href="#securing-your-phpmyadmin-installation">Securing your phpMyAdmin installation</a></li>
429 </ul>
430 </li>
431 </ul>
433 <h4>Previous topic</h4>
434 <p class="topless"><a href="require.html"
435 title="previous chapter">Requirements</a></p>
436 <h4>Next topic</h4>
437 <p class="topless"><a href="config.html"
438 title="next chapter">Configuration</a></p>
439 <h3>This Page</h3>
440 <ul class="this-page-menu">
441 <li><a href="_sources/setup.txt"
442 rel="nofollow">Show Source</a></li>
443 </ul>
444 <div id="searchbox" style="display: none">
445 <h3>Quick search</h3>
446 <form class="search" action="search.html" method="get">
447 <input type="text" name="q" />
448 <input type="submit" value="Go" />
449 <input type="hidden" name="check_keywords" value="yes" />
450 <input type="hidden" name="area" value="default" />
451 </form>
452 <p class="searchtip" style="font-size: 90%">
453 Enter search terms or a module, class or function name.
454 </p>
455 </div>
456 <script type="text/javascript">$('#searchbox').show(0);</script>
457 </div>
458 </div>
459 <div class="clearer"></div>
460 </div>
461 <div class="related">
462 <h3>Navigation</h3>
463 <ul>
464 <li class="right" style="margin-right: 10px">
465 <a href="genindex.html" title="General Index"
466 >index</a></li>
467 <li class="right" >
468 <a href="config.html" title="Configuration"
469 >next</a> |</li>
470 <li class="right" >
471 <a href="require.html" title="Requirements"
472 >previous</a> |</li>
473 <li><a href="index.html">phpMyAdmin 4.0.4 documentation</a> &raquo;</li>
474 </ul>
475 </div>
476 <div class="footer">
477 &copy; <a href="copyright.html">Copyright</a> 2012 - 2013, The phpMyAdmin devel team.
478 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
479 </div>
480 </body>
481 </html>