setup.html 151 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
  6. <title>Installation &#8212; phpMyAdmin 5.2.2 documentation</title>
  7. <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
  8. <link rel="stylesheet" type="text/css" href="_static/classic.css" />
  9. <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
  10. <script src="_static/jquery.js"></script>
  11. <script src="_static/underscore.js"></script>
  12. <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
  13. <script src="_static/doctools.js"></script>
  14. <script src="_static/sphinx_highlight.js"></script>
  15. <link rel="index" title="Index" href="genindex.html" />
  16. <link rel="search" title="Search" href="search.html" />
  17. <link rel="copyright" title="Copyright" href="copyright.html" />
  18. <link rel="next" title="Configuration" href="config.html" />
  19. <link rel="prev" title="Requirements" href="require.html" />
  20. </head><body>
  21. <div class="related" role="navigation" aria-label="related navigation">
  22. <h3>Navigation</h3>
  23. <ul>
  24. <li class="right" style="margin-right: 10px">
  25. <a href="genindex.html" title="General Index"
  26. accesskey="I">index</a></li>
  27. <li class="right" >
  28. <a href="config.html" title="Configuration"
  29. accesskey="N">next</a> |</li>
  30. <li class="right" >
  31. <a href="require.html" title="Requirements"
  32. accesskey="P">previous</a> |</li>
  33. <li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 5.2.2 documentation</a> &#187;</li>
  34. <li class="nav-item nav-item-this"><a href="">Installation</a></li>
  35. </ul>
  36. </div>
  37. <div class="document">
  38. <div class="documentwrapper">
  39. <div class="bodywrapper">
  40. <div class="body" role="main">
  41. <section id="installation">
  42. <span id="setup"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this heading">¶</a></h1>
  43. <p>phpMyAdmin does not apply any special security methods to the MySQL
  44. database server. It is still the system administrator’s job to grant
  45. permissions on the MySQL databases properly. phpMyAdmin’s <span class="guilabel">Users</span>
  46. page can be used for this.</p>
  47. <section id="linux-distributions">
  48. <h2>Linux distributions<a class="headerlink" href="#linux-distributions" title="Permalink to this heading">¶</a></h2>
  49. <p>phpMyAdmin is included in most Linux distributions. It is recommended to use
  50. distribution packages when possible - they usually provide integration to your
  51. distribution and you will automatically get security updates from your distribution.</p>
  52. <section id="debian-and-ubuntu">
  53. <span id="debian-package"></span><h3>Debian and Ubuntu<a class="headerlink" href="#debian-and-ubuntu" title="Permalink to this heading">¶</a></h3>
  54. <p>Most Debian and Ubuntu versions include a phpMyAdmin package, but be aware that
  55. the configuration file is maintained in <code class="docutils literal notranslate"><span class="pre">/etc/phpmyadmin</span></code> and may differ in
  56. some ways from the official phpMyAdmin documentation. Specifically, it does:</p>
  57. <ul class="simple">
  58. <li><p>Configuration of a web server (works for Apache and lighttpd).</p></li>
  59. <li><p>Creating of <a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> using dbconfig-common.</p></li>
  60. <li><p>Securing setup script, see <a class="reference internal" href="#debian-setup"><span class="std std-ref">Setup script on Debian, Ubuntu and derivatives</span></a>.</p></li>
  61. </ul>
  62. <p>More specific details about installing Debian or Ubuntu packages are available
  63. <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/wiki/DebianUbuntu">in our wiki</a>.</p>
  64. <div class="admonition seealso">
  65. <p class="admonition-title">See also</p>
  66. <p>More information can be found in <a class="reference external" href="https://salsa.debian.org/phpmyadmin-team/phpmyadmin/blob/debian/latest/debian/README.Debian">README.Debian</a>
  67. (it is installed as <code class="file docutils literal notranslate"><span class="pre">/usr/share/doc/phpmyadmin/README.Debian</span></code> with the package).</p>
  68. </div>
  69. </section>
  70. <section id="opensuse">
  71. <h3>OpenSUSE<a class="headerlink" href="#opensuse" title="Permalink to this heading">¶</a></h3>
  72. <p>OpenSUSE already comes with phpMyAdmin package, just install packages from
  73. the <a class="reference external" href="https://software.opensuse.org/package/phpMyAdmin">openSUSE Build Service</a>.</p>
  74. </section>
  75. <section id="gentoo">
  76. <h3>Gentoo<a class="headerlink" href="#gentoo" title="Permalink to this heading">¶</a></h3>
  77. <p>Gentoo ships the phpMyAdmin package, both in a near-stock configuration as well
  78. as in a <code class="docutils literal notranslate"><span class="pre">webapp-config</span></code> configuration. Use <code class="docutils literal notranslate"><span class="pre">emerge</span> <span class="pre">dev-db/phpmyadmin</span></code> to
  79. install.</p>
  80. </section>
  81. <section id="mandriva">
  82. <h3>Mandriva<a class="headerlink" href="#mandriva" title="Permalink to this heading">¶</a></h3>
  83. <p>Mandriva ships the phpMyAdmin package in their <code class="docutils literal notranslate"><span class="pre">contrib</span></code> branch and can be
  84. installed via the usual Control Center.</p>
  85. </section>
  86. <section id="fedora">
  87. <h3>Fedora<a class="headerlink" href="#fedora" title="Permalink to this heading">¶</a></h3>
  88. <p>Fedora ships the phpMyAdmin package, but be aware that the configuration file
  89. is maintained in <code class="docutils literal notranslate"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the
  90. official phpMyAdmin documentation.</p>
  91. </section>
  92. <section id="red-hat-enterprise-linux">
  93. <h3>Red Hat Enterprise Linux<a class="headerlink" href="#red-hat-enterprise-linux" title="Permalink to this heading">¶</a></h3>
  94. <p>Red Hat Enterprise Linux itself and thus derivatives like CentOS don’t
  95. ship phpMyAdmin, but the Fedora-driven repository
  96. <a class="reference external" href="https://docs.fedoraproject.org/en-US/epel/">Extra Packages for Enterprise Linux (EPEL)</a>
  97. is doing so, if it’s
  98. <a class="reference external" href="https://fedoraproject.org/wiki/EPEL/FAQ#howtouse">enabled</a>.
  99. But be aware that the configuration file is maintained in
  100. <code class="docutils literal notranslate"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the
  101. official phpMyAdmin documentation.</p>
  102. </section>
  103. </section>
  104. <section id="installing-on-windows">
  105. <h2>Installing on Windows<a class="headerlink" href="#installing-on-windows" title="Permalink to this heading">¶</a></h2>
  106. <p>The easiest way to get phpMyAdmin on Windows is using third party products
  107. which include phpMyAdmin together with a database and web server such as
  108. <a class="reference external" href="https://www.apachefriends.org/index.html">XAMPP</a>.</p>
  109. <p>You can find more of such options at <a class="reference external" href="https://en.wikipedia.org/wiki/List_of_AMP_packages">Wikipedia</a>.</p>
  110. </section>
  111. <section id="installing-from-git">
  112. <h2>Installing from Git<a class="headerlink" href="#installing-from-git" title="Permalink to this heading">¶</a></h2>
  113. <p>In order to install from Git, you’ll need a few supporting applications:</p>
  114. <ul class="simple">
  115. <li><p><a class="reference external" href="https://git-scm.com/downloads">Git</a> to download the source, or you can download the most recent source directly from <a class="reference external" href="https://codeload.github.com/phpmyadmin/phpmyadmin/zip/QA_5_2">Github</a></p></li>
  116. <li><p><a class="reference external" href="https://getcomposer.org/download/">Composer</a></p></li>
  117. <li><p><a class="reference external" href="https://nodejs.org/en/download/">Node.js</a> (version 12 or higher)</p></li>
  118. <li><p><a class="reference external" href="https://classic.yarnpkg.com/en/docs/install">Yarn</a></p></li>
  119. </ul>
  120. <p>You can clone current phpMyAdmin source from
  121. <code class="docutils literal notranslate"><span class="pre">https://github.com/phpmyadmin/phpmyadmin.git</span></code>:</p>
  122. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/phpmyadmin/phpmyadmin.git
  123. </pre></div>
  124. </div>
  125. <p>Additionally you need to install dependencies using <a class="reference external" href="https://getcomposer.org">Composer</a>:</p>
  126. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>update
  127. </pre></div>
  128. </div>
  129. <p>If you do not intend to develop, you can skip the installation of developer tools
  130. by invoking:</p>
  131. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>update<span class="w"> </span>--no-dev
  132. </pre></div>
  133. </div>
  134. <p>Finally, you’ll need to use <a class="reference external" href="https://classic.yarnpkg.com/en/docs/install">Yarn</a> to install some JavaScript dependencies:</p>
  135. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>yarn<span class="w"> </span>install<span class="w"> </span>--production
  136. </pre></div>
  137. </div>
  138. </section>
  139. <section id="installing-using-composer">
  140. <span id="composer"></span><h2>Installing using Composer<a class="headerlink" href="#installing-using-composer" title="Permalink to this heading">¶</a></h2>
  141. <p>You can install phpMyAdmin using the <a class="reference external" href="https://getcomposer.org/">Composer tool</a>, since 4.7.0 the releases
  142. are automatically mirrored to the default <a class="reference external" href="https://packagist.org/">Packagist</a> repository.</p>
  143. <div class="admonition note">
  144. <p class="admonition-title">Note</p>
  145. <p>The content of the Composer repository is automatically generated
  146. separately from the releases, so the content doesn’t have to be
  147. 100% same as when you download the tarball. There should be no
  148. functional differences though.</p>
  149. </div>
  150. <p>To install phpMyAdmin simply run:</p>
  151. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>create-project<span class="w"> </span>phpmyadmin/phpmyadmin
  152. </pre></div>
  153. </div>
  154. <p>Alternatively you can use our own composer repository, which contains
  155. the release tarballs and is available at
  156. &lt;<a class="reference external" href="https://www.phpmyadmin.net/packages.json">https://www.phpmyadmin.net/packages.json</a>&gt;:</p>
  157. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>create-project<span class="w"> </span>phpmyadmin/phpmyadmin<span class="w"> </span>--repository-url<span class="o">=</span>https://www.phpmyadmin.net/packages.json<span class="w"> </span>--no-dev
  158. </pre></div>
  159. </div>
  160. </section>
  161. <section id="installing-using-docker">
  162. <span id="docker"></span><h2>Installing using Docker<a class="headerlink" href="#installing-using-docker" title="Permalink to this heading">¶</a></h2>
  163. <p>phpMyAdmin comes with a <a class="reference external" href="https://hub.docker.com/_/phpmyadmin">Docker official image</a>, which you can easily deploy. You can
  164. download it using:</p>
  165. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>pull<span class="w"> </span>phpmyadmin
  166. </pre></div>
  167. </div>
  168. <p>The phpMyAdmin server will listen on port 80. It supports several ways of
  169. configuring the link to the database server, either by Docker’s link feature
  170. by linking your database container to <code class="docutils literal notranslate"><span class="pre">db</span></code> for phpMyAdmin (by specifying
  171. <code class="docutils literal notranslate"><span class="pre">--link</span> <span class="pre">your_db_host:db</span></code>) or by environment variables (in this case it’s up
  172. to you to set up networking in Docker to allow the phpMyAdmin container to access
  173. the database container over the network).</p>
  174. <section id="docker-environment-variables">
  175. <span id="docker-vars"></span><h3>Docker environment variables<a class="headerlink" href="#docker-environment-variables" title="Permalink to this heading">¶</a></h3>
  176. <p>You can configure several phpMyAdmin features using environment variables:</p>
  177. <dl class="std envvar">
  178. <dt class="sig sig-object std" id="envvar-PMA_ARBITRARY">
  179. <span class="sig-name descname"><span class="pre">PMA_ARBITRARY</span></span><a class="headerlink" href="#envvar-PMA_ARBITRARY" title="Permalink to this definition">¶</a></dt>
  180. <dd><p>Allows you to enter a database server hostname on login form.</p>
  181. <div class="admonition seealso">
  182. <p class="admonition-title">See also</p>
  183. <p><span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['AllowArbitraryServer']</span></code></a></p>
  184. </div>
  185. </dd></dl>
  186. <dl class="std envvar">
  187. <dt class="sig sig-object std" id="envvar-PMA_HOST">
  188. <span class="sig-name descname"><span class="pre">PMA_HOST</span></span><a class="headerlink" href="#envvar-PMA_HOST" title="Permalink to this definition">¶</a></dt>
  189. <dd><p>Hostname or IP address of the database server to use.</p>
  190. <div class="admonition seealso">
  191. <p class="admonition-title">See also</p>
  192. <p><span class="target" id="index-1"></span><a class="reference internal" href="config.html#cfg_Servers_host"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['host']</span></code></a></p>
  193. </div>
  194. </dd></dl>
  195. <dl class="std envvar">
  196. <dt class="sig sig-object std" id="envvar-PMA_HOSTS">
  197. <span class="sig-name descname"><span class="pre">PMA_HOSTS</span></span><a class="headerlink" href="#envvar-PMA_HOSTS" title="Permalink to this definition">¶</a></dt>
  198. <dd><p>Comma-separated hostnames or IP addresses of the database servers to use.</p>
  199. <div class="admonition note">
  200. <p class="admonition-title">Note</p>
  201. <p>Used only if <span class="target" id="index-2"></span><a class="reference internal" href="#envvar-PMA_HOST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_HOST</span></code></a> is empty.</p>
  202. </div>
  203. </dd></dl>
  204. <dl class="std envvar">
  205. <dt class="sig sig-object std" id="envvar-PMA_VERBOSE">
  206. <span class="sig-name descname"><span class="pre">PMA_VERBOSE</span></span><a class="headerlink" href="#envvar-PMA_VERBOSE" title="Permalink to this definition">¶</a></dt>
  207. <dd><p>Verbose name of the database server.</p>
  208. <div class="admonition seealso">
  209. <p class="admonition-title">See also</p>
  210. <p><span class="target" id="index-3"></span><a class="reference internal" href="config.html#cfg_Servers_verbose"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['verbose']</span></code></a></p>
  211. </div>
  212. </dd></dl>
  213. <dl class="std envvar">
  214. <dt class="sig sig-object std" id="envvar-PMA_VERBOSES">
  215. <span class="sig-name descname"><span class="pre">PMA_VERBOSES</span></span><a class="headerlink" href="#envvar-PMA_VERBOSES" title="Permalink to this definition">¶</a></dt>
  216. <dd><p>Comma-separated verbose name of the database servers.</p>
  217. <div class="admonition note">
  218. <p class="admonition-title">Note</p>
  219. <p>Used only if <span class="target" id="index-4"></span><a class="reference internal" href="#envvar-PMA_VERBOSE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_VERBOSE</span></code></a> is empty.</p>
  220. </div>
  221. </dd></dl>
  222. <dl class="std envvar">
  223. <dt class="sig sig-object std" id="envvar-PMA_USER">
  224. <span class="sig-name descname"><span class="pre">PMA_USER</span></span><a class="headerlink" href="#envvar-PMA_USER" title="Permalink to this definition">¶</a></dt>
  225. <dd><p>User name to use for <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  226. </dd></dl>
  227. <dl class="std envvar">
  228. <dt class="sig sig-object std" id="envvar-PMA_PASSWORD">
  229. <span class="sig-name descname"><span class="pre">PMA_PASSWORD</span></span><a class="headerlink" href="#envvar-PMA_PASSWORD" title="Permalink to this definition">¶</a></dt>
  230. <dd><p>Password to use for <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  231. </dd></dl>
  232. <dl class="std envvar">
  233. <dt class="sig sig-object std" id="envvar-PMA_PORT">
  234. <span class="sig-name descname"><span class="pre">PMA_PORT</span></span><a class="headerlink" href="#envvar-PMA_PORT" title="Permalink to this definition">¶</a></dt>
  235. <dd><p>Port of the database server to use.</p>
  236. </dd></dl>
  237. <dl class="std envvar">
  238. <dt class="sig sig-object std" id="envvar-PMA_PORTS">
  239. <span class="sig-name descname"><span class="pre">PMA_PORTS</span></span><a class="headerlink" href="#envvar-PMA_PORTS" title="Permalink to this definition">¶</a></dt>
  240. <dd><p>Comma-separated ports of the database server to use.</p>
  241. <div class="admonition note">
  242. <p class="admonition-title">Note</p>
  243. <p>Used only if <span class="target" id="index-5"></span><a class="reference internal" href="#envvar-PMA_PORT"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_PORT</span></code></a> is empty.</p>
  244. </div>
  245. </dd></dl>
  246. <dl class="std envvar">
  247. <dt class="sig sig-object std" id="envvar-PMA_SOCKET">
  248. <span class="sig-name descname"><span class="pre">PMA_SOCKET</span></span><a class="headerlink" href="#envvar-PMA_SOCKET" title="Permalink to this definition">¶</a></dt>
  249. <dd><p>Socket file for the database connection.</p>
  250. </dd></dl>
  251. <dl class="std envvar">
  252. <dt class="sig sig-object std" id="envvar-PMA_SOCKETS">
  253. <span class="sig-name descname"><span class="pre">PMA_SOCKETS</span></span><a class="headerlink" href="#envvar-PMA_SOCKETS" title="Permalink to this definition">¶</a></dt>
  254. <dd><p>Comma-separated list of socket files for the database connections.</p>
  255. <div class="admonition note">
  256. <p class="admonition-title">Note</p>
  257. <p>Used only if <span class="target" id="index-6"></span><a class="reference internal" href="#envvar-PMA_SOCKET"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_SOCKET</span></code></a> is empty.</p>
  258. </div>
  259. </dd></dl>
  260. <dl class="std envvar">
  261. <dt class="sig sig-object std" id="envvar-PMA_ABSOLUTE_URI">
  262. <span class="sig-name descname"><span class="pre">PMA_ABSOLUTE_URI</span></span><a class="headerlink" href="#envvar-PMA_ABSOLUTE_URI" title="Permalink to this definition">¶</a></dt>
  263. <dd><p>The fully-qualified path (<code class="docutils literal notranslate"><span class="pre">https://pma.example.net/</span></code>) where the reverse
  264. proxy makes phpMyAdmin available.</p>
  265. <div class="admonition seealso">
  266. <p class="admonition-title">See also</p>
  267. <p><span class="target" id="index-7"></span><a class="reference internal" href="config.html#cfg_PmaAbsoluteUri"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['PmaAbsoluteUri']</span></code></a></p>
  268. </div>
  269. </dd></dl>
  270. <dl class="std envvar">
  271. <dt class="sig sig-object std" id="envvar-PMA_QUERYHISTORYDB">
  272. <span class="sig-name descname"><span class="pre">PMA_QUERYHISTORYDB</span></span><a class="headerlink" href="#envvar-PMA_QUERYHISTORYDB" title="Permalink to this definition">¶</a></dt>
  273. <dd><p>When set to <cite>true</cite>, enables storing SQL history to <span class="target" id="index-8"></span><a class="reference internal" href="config.html#cfg_Servers_pmadb"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['pmadb']</span></code></a>.
  274. When <cite>false</cite>, history is stored in the browser and is cleared when logging out.</p>
  275. <div class="admonition seealso">
  276. <p class="admonition-title">See also</p>
  277. <p><span class="target" id="index-9"></span><a class="reference internal" href="config.html#cfg_Servers_history"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['history']</span></code></a></p>
  278. </div>
  279. <div class="admonition seealso">
  280. <p class="admonition-title">See also</p>
  281. <p><span class="target" id="index-10"></span><a class="reference internal" href="config.html#cfg_QueryHistoryDB"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['QueryHistoryDB']</span></code></a></p>
  282. </div>
  283. </dd></dl>
  284. <dl class="std envvar">
  285. <dt class="sig sig-object std" id="envvar-PMA_QUERYHISTORYMAX">
  286. <span class="sig-name descname"><span class="pre">PMA_QUERYHISTORYMAX</span></span><a class="headerlink" href="#envvar-PMA_QUERYHISTORYMAX" title="Permalink to this definition">¶</a></dt>
  287. <dd><p>When set to an integer, controls the number of history items.</p>
  288. <div class="admonition seealso">
  289. <p class="admonition-title">See also</p>
  290. <p><span class="target" id="index-11"></span><a class="reference internal" href="config.html#cfg_QueryHistoryMax"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['QueryHistoryMax']</span></code></a></p>
  291. </div>
  292. </dd></dl>
  293. <dl class="std envvar">
  294. <dt class="sig sig-object std" id="envvar-PMA_CONTROLHOST">
  295. <span class="sig-name descname"><span class="pre">PMA_CONTROLHOST</span></span><a class="headerlink" href="#envvar-PMA_CONTROLHOST" title="Permalink to this definition">¶</a></dt>
  296. <dd><p>When set, this points to an alternate database host used for storing the “<a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>” database.</p>
  297. <div class="admonition seealso">
  298. <p class="admonition-title">See also</p>
  299. <p><span class="target" id="index-12"></span><a class="reference internal" href="config.html#cfg_Servers_controlhost"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controlhost']</span></code></a></p>
  300. </div>
  301. </dd></dl>
  302. <dl class="std envvar">
  303. <dt class="sig sig-object std" id="envvar-PMA_CONTROLUSER">
  304. <span class="sig-name descname"><span class="pre">PMA_CONTROLUSER</span></span><a class="headerlink" href="#envvar-PMA_CONTROLUSER" title="Permalink to this definition">¶</a></dt>
  305. <dd><p>Defines the username for phpMyAdmin to use for the “<a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>” database.</p>
  306. <div class="admonition seealso">
  307. <p class="admonition-title">See also</p>
  308. <p><span class="target" id="index-13"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controluser']</span></code></a></p>
  309. </div>
  310. </dd></dl>
  311. <dl class="std envvar">
  312. <dt class="sig sig-object std" id="envvar-PMA_CONTROLPASS">
  313. <span class="sig-name descname"><span class="pre">PMA_CONTROLPASS</span></span><a class="headerlink" href="#envvar-PMA_CONTROLPASS" title="Permalink to this definition">¶</a></dt>
  314. <dd><p>Defines the password for phpMyAdmin to use for the “<a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>” database.</p>
  315. <div class="admonition seealso">
  316. <p class="admonition-title">See also</p>
  317. <p><span class="target" id="index-14"></span><a class="reference internal" href="config.html#cfg_Servers_controlpass"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controlpass']</span></code></a></p>
  318. </div>
  319. </dd></dl>
  320. <dl class="std envvar">
  321. <dt class="sig sig-object std" id="envvar-PMA_CONTROLPORT">
  322. <span class="sig-name descname"><span class="pre">PMA_CONTROLPORT</span></span><a class="headerlink" href="#envvar-PMA_CONTROLPORT" title="Permalink to this definition">¶</a></dt>
  323. <dd><p>When set, will override the default port (<cite>3306</cite>) for connecting to the control host.</p>
  324. <div class="admonition seealso">
  325. <p class="admonition-title">See also</p>
  326. <p><span class="target" id="index-15"></span><a class="reference internal" href="config.html#cfg_Servers_controlport"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controlport']</span></code></a></p>
  327. </div>
  328. </dd></dl>
  329. <dl class="std envvar">
  330. <dt class="sig sig-object std" id="envvar-PMA_PMADB">
  331. <span class="sig-name descname"><span class="pre">PMA_PMADB</span></span><a class="headerlink" href="#envvar-PMA_PMADB" title="Permalink to this definition">¶</a></dt>
  332. <dd><p>When set, define the name of the database to be used for the “<a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>” database.
  333. When not set, the advanced features are not enabled by default: they can still potentially be enabled by the user when logging in with the <a class="reference internal" href="#zeroconf"><span class="std std-ref">Zero configuration</span></a> feature.</p>
  334. <div class="admonition note">
  335. <p class="admonition-title">Note</p>
  336. <p>Suggested values: <cite>phpmyadmin</cite> or <cite>pmadb</cite></p>
  337. </div>
  338. <div class="admonition seealso">
  339. <p class="admonition-title">See also</p>
  340. <p><span class="target" id="index-16"></span><a class="reference internal" href="config.html#cfg_Servers_pmadb"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['pmadb']</span></code></a></p>
  341. </div>
  342. </dd></dl>
  343. <dl class="std envvar">
  344. <dt class="sig sig-object std" id="envvar-HIDE_PHP_VERSION">
  345. <span class="sig-name descname"><span class="pre">HIDE_PHP_VERSION</span></span><a class="headerlink" href="#envvar-HIDE_PHP_VERSION" title="Permalink to this definition">¶</a></dt>
  346. <dd><p>If defined, this option will hide the PHP version (<cite>expose_php = Off</cite>).
  347. Set to any value (such as <cite>HIDE_PHP_VERSION=true</cite>).</p>
  348. </dd></dl>
  349. <dl class="std envvar">
  350. <dt class="sig sig-object std" id="envvar-UPLOAD_LIMIT">
  351. <span class="sig-name descname"><span class="pre">UPLOAD_LIMIT</span></span><a class="headerlink" href="#envvar-UPLOAD_LIMIT" title="Permalink to this definition">¶</a></dt>
  352. <dd><p>If set, this option will override the default value for apache and php-fpm (this will change <code class="docutils literal notranslate"><span class="pre">upload_max_filesize</span></code> and <code class="docutils literal notranslate"><span class="pre">post_max_size</span></code> values).</p>
  353. <div class="admonition note">
  354. <p class="admonition-title">Note</p>
  355. <p>Format as <cite>[0-9+](K,M,G)</cite> default value is <cite>2048K</cite></p>
  356. </div>
  357. </dd></dl>
  358. <dl class="std envvar">
  359. <dt class="sig sig-object std" id="envvar-MEMORY_LIMIT">
  360. <span class="sig-name descname"><span class="pre">MEMORY_LIMIT</span></span><a class="headerlink" href="#envvar-MEMORY_LIMIT" title="Permalink to this definition">¶</a></dt>
  361. <dd><p>If set, this option will override the phpMyAdmin memory limit <span class="target" id="index-17"></span><a class="reference internal" href="config.html#cfg_MemoryLimit"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['MemoryLimit']</span></code></a> and PHP’s <cite>memory_limit</cite>.</p>
  362. <div class="admonition note">
  363. <p class="admonition-title">Note</p>
  364. <p>Format as <cite>[0-9+](K,M,G)</cite> where <cite>K</cite> is for Kilobytes, <cite>M</cite> for Megabytes, <cite>G</cite> for Gigabytes and <cite>1K</cite> = 1024 bytes. Default value is <cite>512M</cite>.</p>
  365. </div>
  366. </dd></dl>
  367. <dl class="std envvar">
  368. <dt class="sig sig-object std" id="envvar-MAX_EXECUTION_TIME">
  369. <span class="sig-name descname"><span class="pre">MAX_EXECUTION_TIME</span></span><a class="headerlink" href="#envvar-MAX_EXECUTION_TIME" title="Permalink to this definition">¶</a></dt>
  370. <dd><p>If set, this option will override the maximum execution time in seconds for phpMyAdmin <span class="target" id="index-18"></span><a class="reference internal" href="config.html#cfg_ExecTimeLimit"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['ExecTimeLimit']</span></code></a> and PHP’s <cite>max_execution_time</cite>.</p>
  371. <div class="admonition note">
  372. <p class="admonition-title">Note</p>
  373. <p>Format as <cite>[0-9+]</cite>. Default value is <cite>600</cite>.</p>
  374. </div>
  375. </dd></dl>
  376. <dl class="std envvar">
  377. <dt class="sig sig-object std" id="envvar-PMA_CONFIG_BASE64">
  378. <span class="sig-name descname"><span class="pre">PMA_CONFIG_BASE64</span></span><a class="headerlink" href="#envvar-PMA_CONFIG_BASE64" title="Permalink to this definition">¶</a></dt>
  379. <dd><p>If set, this option will override the default <cite>config.inc.php</cite> with the base64 decoded contents of the variable.</p>
  380. </dd></dl>
  381. <dl class="std envvar">
  382. <dt class="sig sig-object std" id="envvar-PMA_USER_CONFIG_BASE64">
  383. <span class="sig-name descname"><span class="pre">PMA_USER_CONFIG_BASE64</span></span><a class="headerlink" href="#envvar-PMA_USER_CONFIG_BASE64" title="Permalink to this definition">¶</a></dt>
  384. <dd><p>If set, this option will override the default <cite>config.user.inc.php</cite> with the base64 decoded contents of the variable.</p>
  385. </dd></dl>
  386. <dl class="std envvar">
  387. <dt class="sig sig-object std" id="envvar-PMA_UPLOADDIR">
  388. <span class="sig-name descname"><span class="pre">PMA_UPLOADDIR</span></span><a class="headerlink" href="#envvar-PMA_UPLOADDIR" title="Permalink to this definition">¶</a></dt>
  389. <dd><p>If set, this option will set the path where files can be saved to be available to import (<span class="target" id="index-19"></span><a class="reference internal" href="config.html#cfg_UploadDir"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['UploadDir']</span></code></a>)</p>
  390. </dd></dl>
  391. <dl class="std envvar">
  392. <dt class="sig sig-object std" id="envvar-PMA_SAVEDIR">
  393. <span class="sig-name descname"><span class="pre">PMA_SAVEDIR</span></span><a class="headerlink" href="#envvar-PMA_SAVEDIR" title="Permalink to this definition">¶</a></dt>
  394. <dd><p>If set, this option will set the path where exported files can be saved (<span class="target" id="index-20"></span><a class="reference internal" href="config.html#cfg_SaveDir"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['SaveDir']</span></code></a>)</p>
  395. </dd></dl>
  396. <dl class="std envvar">
  397. <dt class="sig sig-object std" id="envvar-APACHE_PORT">
  398. <span class="sig-name descname"><span class="pre">APACHE_PORT</span></span><a class="headerlink" href="#envvar-APACHE_PORT" title="Permalink to this definition">¶</a></dt>
  399. <dd><p>If set, this option will change the default Apache port from <cite>80</cite> in case you want it to run on a different port like an unprivileged port. Set to any port value (such as <cite>APACHE_PORT=8090</cite>).</p>
  400. </dd></dl>
  401. <dl class="std envvar">
  402. <dt class="sig sig-object std" id="envvar-PMA_SSL_DIR">
  403. <span class="sig-name descname"><span class="pre">PMA_SSL_DIR</span></span><a class="headerlink" href="#envvar-PMA_SSL_DIR" title="Permalink to this definition">¶</a></dt>
  404. <dd><p>Define the path used for SSL files generated from environment variables, default value is <cite>/etc/phpmyadmin/ssl</cite>.</p>
  405. </dd></dl>
  406. <dl class="std envvar">
  407. <dt class="sig sig-object std" id="envvar-PMA_SSL">
  408. <span class="sig-name descname"><span class="pre">PMA_SSL</span></span><a class="headerlink" href="#envvar-PMA_SSL" title="Permalink to this definition">¶</a></dt>
  409. <dd><p>When set to <cite>1</cite>, defines SSL usage for the MySQL connection.</p>
  410. <div class="admonition seealso">
  411. <p class="admonition-title">See also</p>
  412. <p><span class="target" id="index-21"></span><a class="reference internal" href="config.html#cfg_Servers_ssl"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl']</span></code></a></p>
  413. </div>
  414. </dd></dl>
  415. <dl class="std envvar">
  416. <dt class="sig sig-object std" id="envvar-PMA_SSLS">
  417. <span class="sig-name descname"><span class="pre">PMA_SSLS</span></span><a class="headerlink" href="#envvar-PMA_SSLS" title="Permalink to this definition">¶</a></dt>
  418. <dd><p>Comma-separated list of <cite>0</cite> and <cite>1</cite> defining SSL usage for the corresponding MySQL connections.</p>
  419. </dd></dl>
  420. <dl class="std envvar">
  421. <dt class="sig sig-object std" id="envvar-PMA_SSL_VERIFY">
  422. <span class="sig-name descname"><span class="pre">PMA_SSL_VERIFY</span></span><a class="headerlink" href="#envvar-PMA_SSL_VERIFY" title="Permalink to this definition">¶</a></dt>
  423. <dd><p>When set to <cite>1</cite>, enables SSL certificate verification for the MySQL connection.</p>
  424. <div class="admonition seealso">
  425. <p class="admonition-title">See also</p>
  426. <p><span class="target" id="index-22"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></p>
  427. </div>
  428. </dd></dl>
  429. <dl class="std envvar">
  430. <dt class="sig sig-object std" id="envvar-PMA_SSL_VERIFIES">
  431. <span class="sig-name descname"><span class="pre">PMA_SSL_VERIFIES</span></span><a class="headerlink" href="#envvar-PMA_SSL_VERIFIES" title="Permalink to this definition">¶</a></dt>
  432. <dd><p>Comma-separated list of <cite>0</cite> and <cite>1</cite> to enable or disable SSL certificate verification for multiple MySQL connections.</p>
  433. <div class="admonition seealso">
  434. <p class="admonition-title">See also</p>
  435. <p><span class="target" id="index-23"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></p>
  436. </div>
  437. </dd></dl>
  438. <dl class="std envvar">
  439. <dt class="sig sig-object std" id="envvar-PMA_SSL_CA">
  440. <span class="sig-name descname"><span class="pre">PMA_SSL_CA</span></span><a class="headerlink" href="#envvar-PMA_SSL_CA" title="Permalink to this definition">¶</a></dt>
  441. <dd><p>In the context of mutual TLS security, allows setting your CA file as a string inside the default <cite>config.inc.php</cite>.</p>
  442. <div class="admonition seealso">
  443. <p class="admonition-title">See also</p>
  444. <p><span class="target" id="index-24"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a></p>
  445. </div>
  446. </dd></dl>
  447. <dl class="std envvar">
  448. <dt class="sig sig-object std" id="envvar-PMA_SSL_CAS">
  449. <span class="sig-name descname"><span class="pre">PMA_SSL_CAS</span></span><a class="headerlink" href="#envvar-PMA_SSL_CAS" title="Permalink to this definition">¶</a></dt>
  450. <dd><p>In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of strings inside the default <cite>config.inc.php</cite>.</p>
  451. </dd></dl>
  452. <dl class="std envvar">
  453. <dt class="sig sig-object std" id="envvar-PMA_SSL_CA_BASE64">
  454. <span class="sig-name descname"><span class="pre">PMA_SSL_CA_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_CA_BASE64" title="Permalink to this definition">¶</a></dt>
  455. <dd><p>In the context of mutual TLS security, allows setting your CA file as a base64 string inside the default <cite>config.inc.php</cite>.</p>
  456. <div class="admonition seealso">
  457. <p class="admonition-title">See also</p>
  458. <p><span class="target" id="index-25"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a></p>
  459. </div>
  460. </dd></dl>
  461. <dl class="std envvar">
  462. <dt class="sig sig-object std" id="envvar-PMA_SSL_CAS_BASE64">
  463. <span class="sig-name descname"><span class="pre">PMA_SSL_CAS_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_CAS_BASE64" title="Permalink to this definition">¶</a></dt>
  464. <dd><p>In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of base64 strings inside the default <cite>config.inc.php</cite>.</p>
  465. </dd></dl>
  466. <dl class="std envvar">
  467. <dt class="sig sig-object std" id="envvar-PMA_SSL_CERT">
  468. <span class="sig-name descname"><span class="pre">PMA_SSL_CERT</span></span><a class="headerlink" href="#envvar-PMA_SSL_CERT" title="Permalink to this definition">¶</a></dt>
  469. <dd><p>In the context of mutual TLS security, allows setting your CERT file as a string inside the default <cite>config.inc.php</cite>.</p>
  470. <div class="admonition seealso">
  471. <p class="admonition-title">See also</p>
  472. <p><span class="target" id="index-26"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a></p>
  473. </div>
  474. </dd></dl>
  475. <dl class="std envvar">
  476. <dt class="sig sig-object std" id="envvar-PMA_SSL_CERTS">
  477. <span class="sig-name descname"><span class="pre">PMA_SSL_CERTS</span></span><a class="headerlink" href="#envvar-PMA_SSL_CERTS" title="Permalink to this definition">¶</a></dt>
  478. <dd><p>In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of strings inside the default <cite>config.inc.php</cite>.</p>
  479. </dd></dl>
  480. <dl class="std envvar">
  481. <dt class="sig sig-object std" id="envvar-PMA_SSL_CERT_BASE64">
  482. <span class="sig-name descname"><span class="pre">PMA_SSL_CERT_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_CERT_BASE64" title="Permalink to this definition">¶</a></dt>
  483. <dd><p>In the context of mutual TLS security, allows setting your CERT file as a base64 string inside the default <cite>config.inc.php</cite>.</p>
  484. <div class="admonition seealso">
  485. <p class="admonition-title">See also</p>
  486. <p><span class="target" id="index-27"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a></p>
  487. </div>
  488. </dd></dl>
  489. <dl class="std envvar">
  490. <dt class="sig sig-object std" id="envvar-PMA_SSL_CERTS_BASE64">
  491. <span class="sig-name descname"><span class="pre">PMA_SSL_CERTS_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_CERTS_BASE64" title="Permalink to this definition">¶</a></dt>
  492. <dd><p>In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of base64 strings inside the default <cite>config.inc.php</cite>.</p>
  493. </dd></dl>
  494. <dl class="std envvar">
  495. <dt class="sig sig-object std" id="envvar-PMA_SSL_KEY">
  496. <span class="sig-name descname"><span class="pre">PMA_SSL_KEY</span></span><a class="headerlink" href="#envvar-PMA_SSL_KEY" title="Permalink to this definition">¶</a></dt>
  497. <dd><p>In the context of mutual TLS security, allows setting your KEY file as a string inside the default <cite>config.inc.php</cite>.</p>
  498. </dd></dl>
  499. <dl class="std envvar">
  500. <dt class="sig sig-object std" id="envvar-PMA_SSL_KEYS">
  501. <span class="sig-name descname"><span class="pre">PMA_SSL_KEYS</span></span><a class="headerlink" href="#envvar-PMA_SSL_KEYS" title="Permalink to this definition">¶</a></dt>
  502. <dd><p>In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of strings inside the default <cite>config.inc.php</cite>.</p>
  503. <div class="admonition seealso">
  504. <p class="admonition-title">See also</p>
  505. <p><span class="target" id="index-28"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a></p>
  506. </div>
  507. </dd></dl>
  508. <dl class="std envvar">
  509. <dt class="sig sig-object std" id="envvar-PMA_SSL_KEY_BASE64">
  510. <span class="sig-name descname"><span class="pre">PMA_SSL_KEY_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_KEY_BASE64" title="Permalink to this definition">¶</a></dt>
  511. <dd><p>In the context of mutual TLS security, allows setting your KEY file as a base64 string inside the default <cite>config.inc.php</cite>.</p>
  512. <div class="admonition seealso">
  513. <p class="admonition-title">See also</p>
  514. <p><span class="target" id="index-29"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a></p>
  515. </div>
  516. </dd></dl>
  517. <dl class="std envvar">
  518. <dt class="sig sig-object std" id="envvar-PMA_SSL_KEYS_BASE64">
  519. <span class="sig-name descname"><span class="pre">PMA_SSL_KEYS_BASE64</span></span><a class="headerlink" href="#envvar-PMA_SSL_KEYS_BASE64" title="Permalink to this definition">¶</a></dt>
  520. <dd><p>In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of base64 strings inside the default <cite>config.inc.php</cite>.</p>
  521. </dd></dl>
  522. <dl class="std envvar">
  523. <dt class="sig sig-object std" id="envvar-TZ">
  524. <span class="sig-name descname"><span class="pre">TZ</span></span><a class="headerlink" href="#envvar-TZ" title="Permalink to this definition">¶</a></dt>
  525. <dd><p>If defined, this option will change the default PHP <cite>date.timezone</cite> from <cite>UTC</cite>.</p>
  526. <div class="admonition seealso">
  527. <p class="admonition-title">See also</p>
  528. <p><span class="target" id="index-30"></span><a class="reference internal" href="config.html#cfg_Servers_SessionTimeZone"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SessionTimeZone']</span></code></a></p>
  529. </div>
  530. </dd></dl>
  531. <p>By default, <a class="reference internal" href="#cookie"><span class="std std-ref">Cookie authentication mode</span></a> is used, but if <span class="target" id="index-31"></span><a class="reference internal" href="#envvar-PMA_USER"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_USER</span></code></a> and
  532. <span class="target" id="index-32"></span><a class="reference internal" href="#envvar-PMA_PASSWORD"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_PASSWORD</span></code></a> are set, it is switched to <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  533. <div class="admonition note">
  534. <p class="admonition-title">Note</p>
  535. <p>The credentials you need to log in are stored in the MySQL server, in case
  536. of Docker image, there are various ways to set it (for example
  537. <code class="samp docutils literal notranslate"><span class="pre">MYSQL_ROOT_PASSWORD</span></code> when starting the MySQL container). Please check
  538. documentation for <a class="reference external" href="https://hub.docker.com/_/mariadb">MariaDB container</a>
  539. or <a class="reference external" href="https://hub.docker.com/_/mysql">MySQL container</a>.</p>
  540. </div>
  541. </section>
  542. <section id="customizing-configuration">
  543. <span id="docker-custom"></span><h3>Customizing configuration<a class="headerlink" href="#customizing-configuration" title="Permalink to this heading">¶</a></h3>
  544. <p>Additionally configuration can be tweaked by <code class="file docutils literal notranslate"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code>. If
  545. this file exists, it will be loaded after configuration is generated from above
  546. environment variables, so you can override any configuration variable. This
  547. configuration can be added as a volume when invoking docker using
  548. <cite>-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</cite> parameters.</p>
  549. <p>Note that the supplied configuration file is applied after <a class="reference internal" href="#docker-vars"><span class="std std-ref">Docker environment variables</span></a>,
  550. but you can override any of the values.</p>
  551. <p>For example to change the default behavior of CSV export you can use the following
  552. configuration file:</p>
  553. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  554. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Export&#39;</span><span class="p">][</span><span class="s1">&#39;csv_columns&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
  555. </pre></div>
  556. </div>
  557. <p>You can also use it to define server configuration instead of using the
  558. environment variables listed in <a class="reference internal" href="#docker-vars"><span class="std std-ref">Docker environment variables</span></a>:</p>
  559. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  560. <span class="cm">/* Override Servers array */</span>
  561. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
  562. <span class="mi">1</span> <span class="o">=&gt;</span> <span class="p">[</span>
  563. <span class="s1">&#39;auth_type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;cookie&#39;</span><span class="p">,</span>
  564. <span class="s1">&#39;host&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;mydb1&#39;</span><span class="p">,</span>
  565. <span class="s1">&#39;port&#39;</span> <span class="o">=&gt;</span> <span class="mi">3306</span><span class="p">,</span>
  566. <span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Verbose name 1&#39;</span><span class="p">,</span>
  567. <span class="p">],</span>
  568. <span class="mi">2</span> <span class="o">=&gt;</span> <span class="p">[</span>
  569. <span class="s1">&#39;auth_type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;cookie&#39;</span><span class="p">,</span>
  570. <span class="s1">&#39;host&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;mydb2&#39;</span><span class="p">,</span>
  571. <span class="s1">&#39;port&#39;</span> <span class="o">=&gt;</span> <span class="mi">3306</span><span class="p">,</span>
  572. <span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Verbose name 2&#39;</span><span class="p">,</span>
  573. <span class="p">],</span>
  574. <span class="p">];</span>
  575. </pre></div>
  576. </div>
  577. <div class="admonition seealso">
  578. <p class="admonition-title">See also</p>
  579. <p>See <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> for detailed description of configuration options.</p>
  580. </div>
  581. </section>
  582. <section id="docker-volumes">
  583. <h3>Docker Volumes<a class="headerlink" href="#docker-volumes" title="Permalink to this heading">¶</a></h3>
  584. <p>You can use the following volumes to customize image behavior:</p>
  585. <p><code class="file docutils literal notranslate"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code></p>
  586. <blockquote>
  587. <div><p>Can be used for additional settings, see the previous chapter for more details.</p>
  588. </div></blockquote>
  589. <p><code class="file docutils literal notranslate"><span class="pre">/sessions/</span></code></p>
  590. <blockquote>
  591. <div><p>Directory where PHP sessions are stored. You might want to share this
  592. for example when using <a class="reference internal" href="#auth-signon"><span class="std std-ref">Signon authentication mode</span></a>.</p>
  593. </div></blockquote>
  594. <p><code class="file docutils literal notranslate"><span class="pre">/www/themes/</span></code></p>
  595. <blockquote>
  596. <div><p>Directory where phpMyAdmin looks for themes. By default only those shipped
  597. with phpMyAdmin are included, but you can include additional phpMyAdmin
  598. themes (see <a class="reference internal" href="themes.html#themes"><span class="std std-ref">Custom Themes</span></a>) by using Docker volumes.</p>
  599. </div></blockquote>
  600. </section>
  601. <section id="docker-examples">
  602. <h3>Docker Examples<a class="headerlink" href="#docker-examples" title="Permalink to this heading">¶</a></h3>
  603. <p>To connect phpMyAdmin to a given server use:</p>
  604. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>-e<span class="w"> </span><span class="nv">PMA_HOST</span><span class="o">=</span>dbhost<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>phpmyadmin:latest
  605. </pre></div>
  606. </div>
  607. <p>To connect phpMyAdmin to more servers use:</p>
  608. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>-e<span class="w"> </span><span class="nv">PMA_HOSTS</span><span class="o">=</span>dbhost1,dbhost2,dbhost3<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>phpmyadmin:latest
  609. </pre></div>
  610. </div>
  611. <p>To use arbitrary server option:</p>
  612. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>--link<span class="w"> </span>mysql_db_server:db<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>-e<span class="w"> </span><span class="nv">PMA_ARBITRARY</span><span class="o">=</span><span class="m">1</span><span class="w"> </span>phpmyadmin:latest
  613. </pre></div>
  614. </div>
  615. <p>You can also link the database container using Docker:</p>
  616. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>--link<span class="w"> </span>mysql_db_server:db<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>phpmyadmin:latest
  617. </pre></div>
  618. </div>
  619. <p>Running with additional configuration:</p>
  620. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>--link<span class="w"> </span>mysql_db_server:db<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>-v<span class="w"> </span>/some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php<span class="w"> </span>phpmyadmin:latest
  621. </pre></div>
  622. </div>
  623. <p>Running with additional themes:</p>
  624. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>--name<span class="w"> </span>phpmyadmin<span class="w"> </span>-d<span class="w"> </span>--link<span class="w"> </span>mysql_db_server:db<span class="w"> </span>-p<span class="w"> </span><span class="m">8080</span>:80<span class="w"> </span>-v<span class="w"> </span>/some/local/directory/custom/phpmyadmin/themeName/:/var/www/html/themes/themeName/<span class="w"> </span>phpmyadmin:latest
  625. </pre></div>
  626. </div>
  627. </section>
  628. <section id="using-docker-compose">
  629. <h3>Using docker-compose<a class="headerlink" href="#using-docker-compose" title="Permalink to this heading">¶</a></h3>
  630. <p>Alternatively, you can also use docker-compose with the docker-compose.yml from
  631. &lt;<a class="reference external" href="https://github.com/phpmyadmin/docker">https://github.com/phpmyadmin/docker</a>&gt;. This will run phpMyAdmin with an
  632. arbitrary server - allowing you to specify MySQL/MariaDB server on the login page.</p>
  633. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>compose<span class="w"> </span>up<span class="w"> </span>-d
  634. </pre></div>
  635. </div>
  636. </section>
  637. <section id="customizing-configuration-file-using-docker-compose">
  638. <h3>Customizing configuration file using docker-compose<a class="headerlink" href="#customizing-configuration-file-using-docker-compose" title="Permalink to this heading">¶</a></h3>
  639. <p>You can use an external file to customize phpMyAdmin configuration and pass it
  640. using the volumes directive:</p>
  641. <div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">phpmyadmin</span><span class="p">:</span>
  642. <span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin:latest</span>
  643. <span class="w"> </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  644. <span class="w"> </span><span class="nt">environment</span><span class="p">:</span>
  645. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_ARBITRARY=1</span>
  646. <span class="w"> </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">always</span>
  647. <span class="w"> </span><span class="nt">ports</span><span class="p">:</span>
  648. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8080:80</span>
  649. <span class="w"> </span><span class="nt">volumes</span><span class="p">:</span>
  650. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/sessions</span>
  651. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</span>
  652. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/custom/phpmyadmin/theme/:/www/themes/theme/</span>
  653. </pre></div>
  654. </div>
  655. <div class="admonition seealso">
  656. <p class="admonition-title">See also</p>
  657. <p><a class="reference internal" href="#docker-custom"><span class="std std-ref">Customizing configuration</span></a></p>
  658. </div>
  659. </section>
  660. <section id="running-behind-haproxy-in-a-subdirectory">
  661. <h3>Running behind haproxy in a subdirectory<a class="headerlink" href="#running-behind-haproxy-in-a-subdirectory" title="Permalink to this heading">¶</a></h3>
  662. <p>When you want to expose phpMyAdmin running in a Docker container in a
  663. subdirectory, you need to rewrite the request path in the server proxying the
  664. requests.</p>
  665. <p>For example, using haproxy it can be done as:</p>
  666. <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>frontend http
  667. bind *:80
  668. option forwardfor
  669. option http-server-close
  670. ### NETWORK restriction
  671. acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
  672. # /phpmyadmin
  673. acl phpmyadmin path_dir /phpmyadmin
  674. use_backend phpmyadmin if phpmyadmin LOCALNET
  675. backend phpmyadmin
  676. mode http
  677. reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2
  678. # phpMyAdmin container IP
  679. server localhost 172.30.21.21:80
  680. </pre></div>
  681. </div>
  682. <p>When using traefik, something like following should work:</p>
  683. <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>defaultEntryPoints = [&quot;http&quot;]
  684. [entryPoints]
  685. [entryPoints.http]
  686. address = &quot;:80&quot;
  687. [entryPoints.http.redirect]
  688. regex = &quot;(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$&quot;
  689. replacement = &quot;$1/&quot;
  690. [backends]
  691. [backends.myadmin]
  692. [backends.myadmin.servers.myadmin]
  693. url=&quot;http://internal.address.to.pma&quot;
  694. [frontends]
  695. [frontends.myadmin]
  696. backend = &quot;myadmin&quot;
  697. passHostHeader = true
  698. [frontends.myadmin.routes.default]
  699. rule=&quot;PathPrefixStrip:/phpmyadmin/;AddPrefix:/&quot;
  700. </pre></div>
  701. </div>
  702. <p>You then should specify <span class="target" id="index-33"></span><a class="reference internal" href="#envvar-PMA_ABSOLUTE_URI"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PMA_ABSOLUTE_URI</span></code></a> in the docker-compose
  703. configuration:</p>
  704. <div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;2&#39;</span>
  705. <span class="nt">services</span><span class="p">:</span>
  706. <span class="w"> </span><span class="nt">phpmyadmin</span><span class="p">:</span>
  707. <span class="w"> </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">always</span>
  708. <span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin:latest</span>
  709. <span class="w"> </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  710. <span class="w"> </span><span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  711. <span class="w"> </span><span class="nt">domainname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com</span>
  712. <span class="w"> </span><span class="nt">ports</span><span class="p">:</span>
  713. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8000:80</span>
  714. <span class="w"> </span><span class="nt">environment</span><span class="p">:</span>
  715. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_HOSTS=172.26.36.7,172.26.36.8,172.26.36.9,172.26.36.10</span>
  716. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2</span>
  717. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_USER=root</span>
  718. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_PASSWORD=</span>
  719. <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/</span>
  720. </pre></div>
  721. </div>
  722. </section>
  723. </section>
  724. <section id="ibm-cloud">
  725. <h2>IBM Cloud<a class="headerlink" href="#ibm-cloud" title="Permalink to this heading">¶</a></h2>
  726. <p>One of our users has created a helpful guide for installing phpMyAdmin on the
  727. <a class="reference external" href="https://github.com/KissConsult/phpmyadmin_tutorial#readme">IBM Cloud platform</a>.</p>
  728. </section>
  729. <section id="quick-install">
  730. <span id="id1"></span><h2>Quick Install<a class="headerlink" href="#quick-install" title="Permalink to this heading">¶</a></h2>
  731. <ol class="arabic simple">
  732. <li><p>Choose an appropriate distribution kit from the phpmyadmin.net
  733. Downloads page. Some kits contain only the English messages, others
  734. contain all languages. We’ll assume you chose a kit whose name
  735. looks like <code class="docutils literal notranslate"><span class="pre">phpMyAdmin-x.x.x-all-languages.tar.gz</span></code>.</p></li>
  736. <li><p>Ensure you have downloaded a genuine archive, see <a class="reference internal" href="#verify"><span class="std std-ref">Verifying phpMyAdmin releases</span></a>.</p></li>
  737. <li><p>Untar or unzip the distribution (be sure to unzip the subdirectories):
  738. <code class="docutils literal notranslate"><span class="pre">tar</span> <span class="pre">-xzvf</span> <span class="pre">phpMyAdmin_x.x.x-all-languages.tar.gz</span></code> in your
  739. webserver’s document root. If you don’t have direct access to your
  740. document root, put the files in a directory on your local machine,
  741. and, after step 4, transfer the directory on your web server using,
  742. for example, FTP.</p></li>
  743. <li><p>Ensure that all the scripts have the appropriate owner (if PHP is
  744. running in safe mode, having some scripts with an owner different from
  745. the owner of other scripts will be a problem). See <a class="reference internal" href="faq.html#faq4-2"><span class="std std-ref">4.2 What’s the preferred way of making phpMyAdmin secure against evil access?</span></a> and
  746. <a class="reference internal" href="faq.html#faq1-26"><span class="std std-ref">1.26 I just installed phpMyAdmin in my document root of IIS but I get the error “No input file specified” when trying to run phpMyAdmin.</span></a> for suggestions.</p></li>
  747. <li><p>Now you must configure your installation. There are two methods that
  748. can be used. Traditionally, users have hand-edited a copy of
  749. <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>, but now a wizard-style setup script is provided
  750. for those who prefer a graphical installation. Creating a
  751. <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code> is still a quick way to get started and needed for
  752. some advanced features.</p></li>
  753. </ol>
  754. <section id="manually-creating-the-file">
  755. <h3>Manually creating the file<a class="headerlink" href="#manually-creating-the-file" title="Permalink to this heading">¶</a></h3>
  756. <p>To manually create the file, simply use your text editor to create the
  757. file <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code> (you can copy <code class="file docutils literal notranslate"><span class="pre">config.sample.inc.php</span></code> to get
  758. a minimal configuration file) in the main (top-level) phpMyAdmin
  759. directory (the one that contains <code class="file docutils literal notranslate"><span class="pre">index.php</span></code>). phpMyAdmin first
  760. loads the default configuration values and then overrides those values
  761. with anything found in <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>. If the default value is
  762. okay for a particular setting, there is no need to include it in
  763. <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>. You’ll probably need only a few directives to get going; a
  764. simple configuration may look like this:</p>
  765. <div class="highlight-xml+php notranslate"><div class="highlight"><pre><span></span><span class="cp">&lt;?php</span>
  766. <span class="c1">// The string is a hexadecimal representation of a 32-bytes long string of random bytes.</span>
  767. <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="nb">sodium_hex2bin</span><span class="p">(</span><span class="s1">&#39;f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851&#39;</span><span class="p">);</span>
  768. <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
  769. <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
  770. <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>
  771. <span class="c1">// if you insist on &quot;root&quot; having no password:</span>
  772. <span class="c1">// $cfg[&#39;Servers&#39;][$i][&#39;AllowNoPassword&#39;] = true;</span>
  773. </pre></div>
  774. </div>
  775. <p>Or, if you prefer to not be prompted every time you log in:</p>
  776. <div class="highlight-xml+php notranslate"><div class="highlight"><pre><span></span><span class="cp">&lt;?php</span>
  777. <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
  778. <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
  779. <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>
  780. <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;changeme&#39;</span><span class="p">;</span> <span class="c1">// use here your password</span>
  781. <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>
  782. </pre></div>
  783. </div>
  784. <div class="admonition warning">
  785. <p class="admonition-title">Warning</p>
  786. <p>Storing passwords in the configuration is insecure as anybody can then
  787. manipulate your database.</p>
  788. </div>
  789. <p>For a full explanation of possible configuration values, see the
  790. <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> of this document.</p>
  791. </section>
  792. <section id="using-the-setup-script">
  793. <span id="setup-script"></span><span id="index-34"></span><h3>Using the Setup script<a class="headerlink" href="#using-the-setup-script" title="Permalink to this heading">¶</a></h3>
  794. <p>Instead of manually editing <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>, you can use phpMyAdmin’s
  795. setup feature. The file can be generated using the setup and you can download it
  796. for upload to the server.</p>
  797. <p>Next, open your browser and visit the location where you installed phpMyAdmin,
  798. with the <code class="docutils literal notranslate"><span class="pre">/setup</span></code> suffix. The changes are not saved to the server, you need to
  799. use the <span class="guilabel">Download</span> button to save them to your computer and then upload
  800. to the server.</p>
  801. <p>Now the file is ready to be used. You can choose to review or edit the
  802. file with your favorite editor, if you prefer to set some advanced
  803. options that the setup script does not provide.</p>
  804. <ol class="arabic simple">
  805. <li><p>If you are using the <code class="docutils literal notranslate"><span class="pre">auth_type</span></code> “config”, it is suggested that you
  806. protect the phpMyAdmin installation directory because using config
  807. does not require a user to enter a password to access the phpMyAdmin
  808. installation. Use of an alternate authentication method is
  809. recommended, for example with HTTP–AUTH in a <a class="reference internal" href="glossary.html#term-.htaccess"><span class="xref std std-term">.htaccess</span></a> file or switch to using
  810. <code class="docutils literal notranslate"><span class="pre">auth_type</span></code> cookie or http. See the <a class="reference internal" href="faq.html#faqmultiuser"><span class="std std-ref">ISPs, multi-user installations</span></a>
  811. for additional information, especially <a class="reference internal" href="faq.html#faq4-4"><span class="std std-ref">4.4 phpMyAdmin always gives “Access denied” when using HTTP authentication.</span></a>.</p></li>
  812. <li><p>Open the main phpMyAdmin directory in your browser.
  813. phpMyAdmin should now display a welcome screen and your databases, or
  814. a login dialog if using <a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a> or
  815. cookie authentication mode.</p></li>
  816. </ol>
  817. <section id="setup-script-on-debian-ubuntu-and-derivatives">
  818. <span id="debian-setup"></span><h4>Setup script on Debian, Ubuntu and derivatives<a class="headerlink" href="#setup-script-on-debian-ubuntu-and-derivatives" title="Permalink to this heading">¶</a></h4>
  819. <p>Debian and Ubuntu have changed the way in which the setup script is enabled and disabled, in a way
  820. that single command has to be executed for either of these.</p>
  821. <p>To allow editing configuration invoke:</p>
  822. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>/usr/sbin/pma-configure
  823. </pre></div>
  824. </div>
  825. <p>To block editing configuration invoke:</p>
  826. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>/usr/sbin/pma-secure
  827. </pre></div>
  828. </div>
  829. </section>
  830. <section id="setup-script-on-opensuse">
  831. <h4>Setup script on openSUSE<a class="headerlink" href="#setup-script-on-opensuse" title="Permalink to this heading">¶</a></h4>
  832. <p>Some openSUSE releases do not include setup script in the package. In case you
  833. want to generate configuration on these you can either download original
  834. package from &lt;<a class="reference external" href="https://www.phpmyadmin.net/">https://www.phpmyadmin.net/</a>&gt; or use setup script on our demo
  835. server: &lt;<a class="reference external" href="https://demo.phpmyadmin.net/master/setup/">https://demo.phpmyadmin.net/master/setup/</a>&gt;.</p>
  836. </section>
  837. </section>
  838. </section>
  839. <section id="verifying-phpmyadmin-releases">
  840. <span id="verify"></span><h2>Verifying phpMyAdmin releases<a class="headerlink" href="#verifying-phpmyadmin-releases" title="Permalink to this heading">¶</a></h2>
  841. <p>Since July 2015 all phpMyAdmin releases are cryptographically signed by the
  842. releasing developer, who through January 2016 was Marc Delisle. His key id is
  843. 0xFEFC65D181AF644A, his PGP fingerprint is:</p>
  844. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A</span>
  845. </pre></div>
  846. </div>
  847. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/lem9">https://keybase.io/lem9</a>&gt;.</p>
  848. <p>Beginning in January 2016, the release manager is Isaac Bennetch. His key id is
  849. 0xCE752F178259BD92, and his PGP fingerprint is:</p>
  850. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92</span>
  851. </pre></div>
  852. </div>
  853. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/ibennetch">https://keybase.io/ibennetch</a>&gt;.</p>
  854. <p>Some additional downloads (for example themes) might be signed by Michal Čihař. His key id is
  855. 0x9C27B31342B7511D, and his PGP fingerprint is:</p>
  856. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D</span>
  857. </pre></div>
  858. </div>
  859. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/nijel">https://keybase.io/nijel</a>&gt;.</p>
  860. <p>You should verify that the signature matches the archive you have downloaded.
  861. This way you can be sure that you are using the same code that was released.
  862. You should also verify the date of the signature to make sure that you
  863. downloaded the latest version.</p>
  864. <p>Each archive is accompanied by <code class="docutils literal notranslate"><span class="pre">.asc</span></code> files which contain the PGP signature
  865. for it. Once you have both of them in the same folder, you can verify the signature:</p>
  866. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--verify<span class="w"> </span>phpMyAdmin-4.5.4.1-all-languages.zip.asc
  867. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  868. <span class="go">gpg: Can&#39;t check signature: public key not found</span>
  869. </pre></div>
  870. </div>
  871. <p>As you can see gpg complains that it does not know the public key. At this
  872. point, you should do one of the following steps:</p>
  873. <ul class="simple">
  874. <li><p>Download the keyring from <a class="reference external" href="https://files.phpmyadmin.net/phpmyadmin.keyring">our download server</a>, then import it with:</p></li>
  875. </ul>
  876. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--import<span class="w"> </span>phpmyadmin.keyring
  877. </pre></div>
  878. </div>
  879. <ul class="simple">
  880. <li><p>Download and import the key from one of the key servers:</p></li>
  881. </ul>
  882. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--keyserver<span class="w"> </span>hkp://pgp.mit.edu<span class="w"> </span>--recv-keys<span class="w"> </span>3D06A59ECE730EB71B511C17CE752F178259BD92
  883. <span class="go">gpg: requesting key 8259BD92 from hkp server pgp.mit.edu</span>
  884. <span class="go">gpg: key 8259BD92: public key &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; imported</span>
  885. <span class="go">gpg: no ultimately trusted keys found</span>
  886. <span class="go">gpg: Total number processed: 1</span>
  887. <span class="go">gpg: imported: 1 (RSA: 1)</span>
  888. </pre></div>
  889. </div>
  890. <p>This will improve the situation a bit - at this point, you can verify that the
  891. signature from the given key is correct but you still can not trust the name used
  892. in the key:</p>
  893. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--verify<span class="w"> </span>phpMyAdmin-4.5.4.1-all-languages.zip.asc
  894. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  895. <span class="go">gpg: Good signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot;</span>
  896. <span class="go">gpg: aka &quot;Isaac Bennetch &lt;isaac@bennetch.org&gt;&quot;</span>
  897. <span class="go">gpg: WARNING: This key is not certified with a trusted signature!</span>
  898. <span class="go">gpg: There is no indication that the signature belongs to the owner.</span>
  899. <span class="go">Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92</span>
  900. </pre></div>
  901. </div>
  902. <p>The problem here is that anybody could issue the key with this name. You need to
  903. ensure that the key is actually owned by the mentioned person. The GNU Privacy
  904. Handbook covers this topic in the chapter <a class="reference external" href="https://www.gnupg.org/gph/en/manual.html#AEN335">Validating other keys on your public
  905. keyring</a>. The most reliable method is to meet the developer in person and
  906. exchange key fingerprints, however, you can also rely on the web of trust. This way
  907. you can trust the key transitively though signatures of others, who have met
  908. the developer in person.</p>
  909. <p>Once the key is trusted, the warning will not occur:</p>
  910. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--verify<span class="w"> </span>phpMyAdmin-4.5.4.1-all-languages.zip.asc
  911. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  912. <span class="go">gpg: Good signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; [full]</span>
  913. </pre></div>
  914. </div>
  915. <p>Should the signature be invalid (the archive has been changed), you would get a
  916. clear error regardless of the fact that the key is trusted or not:</p>
  917. <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>gpg<span class="w"> </span>--verify<span class="w"> </span>phpMyAdmin-4.5.4.1-all-languages.zip.asc
  918. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  919. <span class="go">gpg: BAD signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; [unknown]</span>
  920. </pre></div>
  921. </div>
  922. </section>
  923. <section id="phpmyadmin-configuration-storage">
  924. <span id="linked-tables"></span><span id="index-35"></span><h2>phpMyAdmin configuration storage<a class="headerlink" href="#phpmyadmin-configuration-storage" title="Permalink to this heading">¶</a></h2>
  925. <div class="versionchanged">
  926. <p><span class="versionmodified changed">Changed in version 3.4.0: </span>Prior to phpMyAdmin 3.4.0 this was called Linked Tables Infrastructure, but
  927. the name was changed due to the extended scope of the storage.</p>
  928. </div>
  929. <p>For a whole set of additional features (<a class="reference internal" href="bookmarks.html#bookmarks"><span class="std std-ref">Bookmarks</span></a>, comments, <a class="reference internal" href="glossary.html#term-SQL"><span class="xref std std-term">SQL</span></a>-history,
  930. tracking mechanism, <a class="reference internal" href="glossary.html#term-PDF"><span class="xref std std-term">PDF</span></a>-generation, <a class="reference internal" href="transformations.html#transformations"><span class="std std-ref">Transformations</span></a>, <a class="reference internal" href="relations.html#relations"><span class="std std-ref">Relations</span></a>
  931. etc.) you need to create a set of special tables. Those tables can be located
  932. in your own database, or in a central database for a multi-user installation
  933. (this database would then be accessed by the controluser, so no other user
  934. should have rights to it).</p>
  935. <section id="zero-configuration">
  936. <span id="zeroconf"></span><h3>Zero configuration<a class="headerlink" href="#zero-configuration" title="Permalink to this heading">¶</a></h3>
  937. <p>In many cases, this database structure can be automatically created and
  938. configured. This is called “Zero Configuration” mode and can be particularly
  939. useful in shared hosting situations. “Zeroconf” mode is on by default, to
  940. disable set <span class="target" id="index-36"></span><a class="reference internal" href="config.html#cfg_ZeroConf"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['ZeroConf']</span></code></a> to false.</p>
  941. <p>The following three scenarios are covered by the Zero Configuration mode:</p>
  942. <ul class="simple">
  943. <li><p>When entering a database where the configuration storage tables are not
  944. present, phpMyAdmin offers to create them from the Operations tab.</p></li>
  945. <li><p>When entering a database where the tables do already exist, the software
  946. automatically detects this and begins using them. This is the most common
  947. situation; after the tables are initially created automatically they are
  948. continually used without disturbing the user; this is also most useful on
  949. shared hosting where the user is not able to edit <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code> and
  950. usually the user only has access to one database.</p></li>
  951. <li><p>When having access to multiple databases, if the user first enters the
  952. database containing the configuration storage tables then switches to
  953. another database,
  954. phpMyAdmin continues to use the tables from the first database; the user is
  955. not prompted to create more tables in the new database.</p></li>
  956. </ul>
  957. </section>
  958. <section id="manual-configuration">
  959. <h3>Manual configuration<a class="headerlink" href="#manual-configuration" title="Permalink to this heading">¶</a></h3>
  960. <p>Please look at your <code class="docutils literal notranslate"><span class="pre">./sql/</span></code> directory, where you should find a
  961. file called <em>create_tables.sql</em>. (If you are using a Windows server,
  962. pay special attention to <a class="reference internal" href="faq.html#faq1-23"><span class="std std-ref">1.23 I’m running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!</span></a>).</p>
  963. <p>If you already had this infrastructure and:</p>
  964. <ul class="simple">
  965. <li><p>upgraded to MySQL 4.1.2 or newer, please use
  966. <code class="file docutils literal notranslate"><span class="pre">sql/upgrade_tables_mysql_4_1_2+.sql</span></code>.</p></li>
  967. <li><p>upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (&lt;= 4.2.x),
  968. please use <code class="file docutils literal notranslate"><span class="pre">sql/upgrade_column_info_4_3_0+.sql</span></code>.</p></li>
  969. <li><p>upgraded to phpMyAdmin 4.7.0 or newer from 4.3.0 or newer,
  970. please use <code class="file docutils literal notranslate"><span class="pre">sql/upgrade_tables_4_7_0+.sql</span></code>.</p></li>
  971. </ul>
  972. <p>and then create new tables by importing <code class="file docutils literal notranslate"><span class="pre">sql/create_tables.sql</span></code>.</p>
  973. <p>You can use your phpMyAdmin to create the tables for you. Please be
  974. aware that you may need special (administrator) privileges to create
  975. the database and tables, and that the script may need some tuning,
  976. depending on the database name.</p>
  977. <p>After having imported the <code class="file docutils literal notranslate"><span class="pre">sql/create_tables.sql</span></code> file, you
  978. should specify the table names in your <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code> file. The
  979. directives used for that can be found in the <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a>.</p>
  980. <p>You will also need to have a controluser
  981. (<span class="target" id="index-37"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controluser']</span></code></a> and
  982. <span class="target" id="index-38"></span><a class="reference internal" href="config.html#cfg_Servers_controlpass"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controlpass']</span></code></a> settings)
  983. with the proper rights to those tables. For example you can create it
  984. using following statement:</p>
  985. <p>And for any MariaDB version:</p>
  986. <div class="highlight-mysql notranslate"><div class="highlight"><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="w"> </span><span class="k">IDENTIFIED</span><span class="w"> </span><span class="n">VIA</span><span class="w"> </span><span class="n">mysql_native_password</span><span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="s1">&#39;pmapass&#39;</span><span class="p">;</span>
  987. <span class="k">GRANT</span><span class="w"> </span><span class="k">SELECT</span><span class="p">,</span><span class="w"> </span><span class="k">INSERT</span><span class="p">,</span><span class="w"> </span><span class="k">UPDATE</span><span class="p">,</span><span class="w"> </span><span class="k">DELETE</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n n-Quoted">`&lt;pma_db&gt;`</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="p">;</span>
  988. </pre></div>
  989. </div>
  990. <p>For MySQL 8.0 and newer:</p>
  991. <div class="highlight-mysql notranslate"><div class="highlight"><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="w"> </span><span class="k">IDENTIFIED</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">caching_sha2_password</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">&#39;pmapass&#39;</span><span class="p">;</span>
  992. <span class="k">GRANT</span><span class="w"> </span><span class="k">SELECT</span><span class="p">,</span><span class="w"> </span><span class="k">INSERT</span><span class="p">,</span><span class="w"> </span><span class="k">UPDATE</span><span class="p">,</span><span class="w"> </span><span class="k">DELETE</span><span class="w"> </span><span class="k">ON</span><span class="w"> </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="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="p">;</span>
  993. </pre></div>
  994. </div>
  995. <p>For MySQL older than 8.0:</p>
  996. <div class="highlight-mysql notranslate"><div class="highlight"><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="w"> </span><span class="k">IDENTIFIED</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">mysql_native_password</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="s1">&#39;pmapass&#39;</span><span class="p">;</span>
  997. <span class="k">GRANT</span><span class="w"> </span><span class="k">SELECT</span><span class="p">,</span><span class="w"> </span><span class="k">INSERT</span><span class="p">,</span><span class="w"> </span><span class="k">UPDATE</span><span class="p">,</span><span class="w"> </span><span class="k">DELETE</span><span class="w"> </span><span class="k">ON</span><span class="w"> </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="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">&#39;pma&#39;</span><span class="nv">@&#39;localhost&#39;</span><span class="p">;</span>
  998. </pre></div>
  999. </div>
  1000. <p>Note that MySQL installations with PHP older than 7.4 and MySQL newer than 8.0 may require
  1001. using the mysql_native_password authentication as a workaround, see
  1002. <a class="reference internal" href="faq.html#faq1-45"><span class="std std-ref">1.45 I get an error message about unknown authentication method caching_sha2_password when trying to log in</span></a> for details.</p>
  1003. </section>
  1004. </section>
  1005. <section id="upgrading-from-an-older-version">
  1006. <span id="upgrading"></span><h2>Upgrading from an older version<a class="headerlink" href="#upgrading-from-an-older-version" title="Permalink to this heading">¶</a></h2>
  1007. <div class="admonition warning">
  1008. <p class="admonition-title">Warning</p>
  1009. <p><strong>Never</strong> extract the new version over an existing installation of
  1010. phpMyAdmin, always first remove the old files keeping just the
  1011. configuration.</p>
  1012. <p>This way, you will not leave any old or outdated files in the directory,
  1013. which can have severe security implications or can cause various breakages.</p>
  1014. </div>
  1015. <p>Simply copy <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code> from your previous installation into
  1016. the newly unpacked one. Configuration files from old versions may
  1017. require some tweaking as some options have been changed or removed.
  1018. For compatibility with PHP 5.3 and later, remove a
  1019. <code class="docutils literal notranslate"><span class="pre">set_magic_quotes_runtime(0);</span></code> statement that you might find near
  1020. the end of your configuration file.</p>
  1021. <p>The complete upgrade can be performed in a few simple steps:</p>
  1022. <ol class="arabic simple">
  1023. <li><p>Download the latest phpMyAdmin version from &lt;<a class="reference external" href="https://www.phpmyadmin.net/downloads/">https://www.phpmyadmin.net/downloads/</a>&gt;.</p></li>
  1024. <li><p>Rename existing phpMyAdmin folder (for example to <code class="docutils literal notranslate"><span class="pre">phpmyadmin-old</span></code>).</p></li>
  1025. <li><p>Unpack freshly downloaded phpMyAdmin to the desired location (for example <code class="docutils literal notranslate"><span class="pre">phpmyadmin</span></code>).</p></li>
  1026. <li><p>Copy <code class="file docutils literal notranslate"><span class="pre">config.inc.php`</span></code> from old location (<code class="docutils literal notranslate"><span class="pre">phpmyadmin-old</span></code>) to the new one (<code class="docutils literal notranslate"><span class="pre">phpmyadmin</span></code>).</p></li>
  1027. <li><p>Test that everything works properly.</p></li>
  1028. <li><p>Remove backup of a previous version (<code class="docutils literal notranslate"><span class="pre">phpmyadmin-old</span></code>).</p></li>
  1029. </ol>
  1030. <p>If you have upgraded your MySQL server from a version previous to 4.1.2 to
  1031. version 5.x or newer and if you use the phpMyAdmin configuration storage, you
  1032. should run the <a class="reference internal" href="glossary.html#term-SQL"><span class="xref std std-term">SQL</span></a> script found in
  1033. <code class="file docutils literal notranslate"><span class="pre">sql/upgrade_tables_mysql_4_1_2+.sql</span></code>.</p>
  1034. <p>If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or
  1035. newer (&lt;= 4.2.x) and if you use the phpMyAdmin configuration storage, you
  1036. should run the <a class="reference internal" href="glossary.html#term-SQL"><span class="xref std std-term">SQL</span></a> script found in
  1037. <code class="file docutils literal notranslate"><span class="pre">sql/upgrade_column_info_4_3_0+.sql</span></code>.</p>
  1038. <p>Do not forget to clear the browser cache and to empty the old session by
  1039. logging out and logging in again.</p>
  1040. </section>
  1041. <section id="using-authentication-modes">
  1042. <span id="authentication-modes"></span><span id="index-39"></span><h2>Using authentication modes<a class="headerlink" href="#using-authentication-modes" title="Permalink to this heading">¶</a></h2>
  1043. <p><a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a> and cookie authentication modes are recommended in a <strong>multi-user
  1044. environment</strong> where you want to give users access to their own database and
  1045. don’t want them to play around with others. Nevertheless, be aware that MS
  1046. Internet Explorer seems to be really buggy about cookies, at least till version
  1047. 6. Even in a <strong>single-user environment</strong>, you might prefer to use <a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a>
  1048. or cookie mode so that your user/password pair are not in clear in the
  1049. configuration file.</p>
  1050. <p><a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a> and cookie authentication
  1051. modes are more secure: the MySQL login information does not need to be
  1052. set in the phpMyAdmin configuration file (except possibly for the
  1053. <span class="target" id="index-40"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['controluser']</span></code></a>).
  1054. However, keep in mind that the password travels in plain text unless
  1055. you are using the HTTPS protocol. In cookie mode, the password is
  1056. stored, encrypted with the AES algorithm, in a temporary cookie.</p>
  1057. <p>Then each of the <em>true</em> users should be granted a set of privileges
  1058. on a set of particular databases. Normally you shouldn’t give global
  1059. privileges to an ordinary user unless you understand the impact of those
  1060. privileges (for example, you are creating a superuser).
  1061. For example, to grant the user <em>real_user</em> with all privileges on
  1062. the database <em>user_base</em>:</p>
  1063. <div class="highlight-mysql notranslate"><div class="highlight"><pre><span></span><span class="k">GRANT</span><span class="w"> </span><span class="k">ALL</span><span class="w"> </span><span class="k">PRIVILEGES</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">user_base</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">&#39;real_user&#39;</span><span class="nv">@localhost</span><span class="w"> </span><span class="k">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">&#39;real_password&#39;</span><span class="p">;</span>
  1064. </pre></div>
  1065. </div>
  1066. <p>What the user may now do is controlled entirely by the MySQL user management
  1067. system. With HTTP or cookie authentication mode, you don’t need to fill the
  1068. user/password fields inside the <span class="target" id="index-41"></span><a class="reference internal" href="config.html#cfg_Servers"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers']</span></code></a>.</p>
  1069. <div class="admonition seealso">
  1070. <p class="admonition-title">See also</p>
  1071. <p><a class="reference internal" href="faq.html#faq1-32"><span class="std std-ref">1.32 Can I use HTTP authentication with IIS?</span></a>,
  1072. <a class="reference internal" href="faq.html#faq1-35"><span class="std std-ref">1.35 Can I use HTTP authentication with Apache CGI?</span></a>,
  1073. <a class="reference internal" href="faq.html#faq4-1"><span class="std std-ref">4.1 I’m an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer?</span></a>,
  1074. <a class="reference internal" href="faq.html#faq4-2"><span class="std std-ref">4.2 What’s the preferred way of making phpMyAdmin secure against evil access?</span></a>,
  1075. <a class="reference internal" href="faq.html#faq4-3"><span class="std std-ref">4.3 I get errors about not being able to include a file in /lang or in /libraries.</span></a></p>
  1076. </div>
  1077. <section id="http-authentication-mode">
  1078. <span id="auth-http"></span><span id="index-42"></span><h3>HTTP authentication mode<a class="headerlink" href="#http-authentication-mode" title="Permalink to this heading">¶</a></h3>
  1079. <ul>
  1080. <li><p>Uses <a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a> Basic authentication
  1081. method and allows you to log in as any valid MySQL user.</p></li>
  1082. <li><p>Is supported with most PHP configurations. For <a class="reference internal" href="glossary.html#term-IIS"><span class="xref std std-term">IIS</span></a> (<a class="reference internal" href="glossary.html#term-ISAPI"><span class="xref std std-term">ISAPI</span></a>)
  1083. support using <a class="reference internal" href="glossary.html#term-CGI"><span class="xref std std-term">CGI</span></a> PHP see <a class="reference internal" href="faq.html#faq1-32"><span class="std std-ref">1.32 Can I use HTTP authentication with IIS?</span></a>, for using with Apache
  1084. <a class="reference internal" href="glossary.html#term-CGI"><span class="xref std std-term">CGI</span></a> see <a class="reference internal" href="faq.html#faq1-35"><span class="std std-ref">1.35 Can I use HTTP authentication with Apache CGI?</span></a>.</p></li>
  1085. <li><p>When PHP is running under Apache’s <a class="reference internal" href="glossary.html#term-mod_proxy_fcgi"><span class="xref std std-term">mod_proxy_fcgi</span></a> (e.g. with PHP-FPM),
  1086. <code class="docutils literal notranslate"><span class="pre">Authorization</span></code> headers are not passed to the underlying FCGI application,
  1087. such that your credentials will not reach the application. In this case, you can
  1088. add the following configuration directive:</p>
  1089. <div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nb">SetEnvIf</span><span class="w"> </span>Authorization<span class="w"> </span><span class="s2">&quot;(.*)&quot;</span><span class="w"> </span>HTTP_AUTHORIZATION=$1
  1090. </pre></div>
  1091. </div>
  1092. </li>
  1093. <li><p>See also <a class="reference internal" href="faq.html#faq4-4"><span class="std std-ref">4.4 phpMyAdmin always gives “Access denied” when using HTTP authentication.</span></a> about not using the <a class="reference internal" href="glossary.html#term-.htaccess"><span class="xref std std-term">.htaccess</span></a> mechanism along with
  1094. ‘<a class="reference internal" href="glossary.html#term-HTTP"><span class="xref std std-term">HTTP</span></a>’ authentication mode.</p></li>
  1095. </ul>
  1096. <div class="admonition note">
  1097. <p class="admonition-title">Note</p>
  1098. <p>There is no way to do proper logout in HTTP authentication, most browsers
  1099. will remember credentials until there is no different successful
  1100. authentication. Because of this, this method has a limitation that you can not
  1101. login with the same user after logout.</p>
  1102. </div>
  1103. </section>
  1104. <section id="cookie-authentication-mode">
  1105. <span id="cookie"></span><span id="index-43"></span><h3>Cookie authentication mode<a class="headerlink" href="#cookie-authentication-mode" title="Permalink to this heading">¶</a></h3>
  1106. <ul class="simple">
  1107. <li><p>Username and password are stored in cookies during the session and password
  1108. is deleted when it ends.</p></li>
  1109. <li><p>With this mode, the user can truly log out of phpMyAdmin and log
  1110. back in with the same username (this is not possible with <a class="reference internal" href="#auth-http"><span class="std std-ref">HTTP authentication mode</span></a>).</p></li>
  1111. <li><p>If you want to allow users to enter any hostname to connect (rather than only
  1112. servers that are configured in <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>),
  1113. see the <span class="target" id="index-44"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['AllowArbitraryServer']</span></code></a> directive.</p></li>
  1114. <li><p>As mentioned in the <a class="reference internal" href="require.html#require"><span class="std std-ref">Requirements</span></a> section, having the <code class="docutils literal notranslate"><span class="pre">openssl</span></code> extension
  1115. will speed up access considerably, but is not required.</p></li>
  1116. </ul>
  1117. </section>
  1118. <section id="signon-authentication-mode">
  1119. <span id="auth-signon"></span><span id="index-45"></span><h3>Signon authentication mode<a class="headerlink" href="#signon-authentication-mode" title="Permalink to this heading">¶</a></h3>
  1120. <ul class="simple">
  1121. <li><p>This mode is a convenient way of using credentials from another
  1122. application to authenticate to phpMyAdmin to implement a single signon
  1123. solution.</p></li>
  1124. <li><p>The other application has to store login information into session
  1125. data (see <span class="target" id="index-46"></span><a class="reference internal" href="config.html#cfg_Servers_SignonSession"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonSession']</span></code></a> and
  1126. <span class="target" id="index-47"></span><a class="reference internal" href="config.html#cfg_Servers_SignonCookieParams"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonCookieParams']</span></code></a>) or you
  1127. need to implement script to return the credentials (see
  1128. <span class="target" id="index-48"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>).</p></li>
  1129. <li><p>When no credentials are available, the user is being redirected to
  1130. <span class="target" id="index-49"></span><a class="reference internal" href="config.html#cfg_Servers_SignonURL"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonURL']</span></code></a>, where you should handle
  1131. the login process.</p></li>
  1132. </ul>
  1133. <p>The very basic example of saving credentials in a session is available as
  1134. <code class="file docutils literal notranslate"><span class="pre">examples/signon.php</span></code>:</p>
  1135. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  1136. <span class="sd">/**</span>
  1137. <span class="sd"> * Single signon for phpMyAdmin</span>
  1138. <span class="sd"> *</span>
  1139. <span class="sd"> * This is just example how to use session based single signon with</span>
  1140. <span class="sd"> * phpMyAdmin, it is not intended to be perfect code and look, only</span>
  1141. <span class="sd"> * shows how you can integrate this functionality in your application.</span>
  1142. <span class="sd"> */</span>
  1143. <span class="k">declare</span><span class="p">(</span><span class="nx">strict_types</span><span class="o">=</span><span class="mi">1</span><span class="p">);</span>
  1144. <span class="cm">/* Use cookies for session */</span>
  1145. <span class="nb">ini_set</span><span class="p">(</span><span class="s1">&#39;session.use_cookies&#39;</span><span class="p">,</span> <span class="s1">&#39;true&#39;</span><span class="p">);</span>
  1146. <span class="cm">/* Change this to true if using phpMyAdmin over https */</span>
  1147. <span class="nv">$secure_cookie</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
  1148. <span class="cm">/* Need to have cookie visible from parent directory */</span>
  1149. <span class="nb">session_set_cookie_params</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$secure_cookie</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
  1150. <span class="cm">/* Create signon session */</span>
  1151. <span class="nv">$session_name</span> <span class="o">=</span> <span class="s1">&#39;SignonSession&#39;</span><span class="p">;</span>
  1152. <span class="nb">session_name</span><span class="p">(</span><span class="nv">$session_name</span><span class="p">);</span>
  1153. <span class="c1">// Uncomment and change the following line to match your $cfg[&#39;SessionSavePath&#39;]</span>
  1154. <span class="c1">//session_save_path(&#39;/foobar&#39;);</span>
  1155. <span class="o">@</span><span class="nb">session_start</span><span class="p">();</span>
  1156. <span class="cm">/* Was data posted? */</span>
  1157. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1158. <span class="cm">/* Store there credentials */</span>
  1159. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">];</span>
  1160. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;password&#39;</span><span class="p">];</span>
  1161. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_host&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;host&#39;</span><span class="p">];</span>
  1162. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_port&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;port&#39;</span><span class="p">];</span>
  1163. <span class="cm">/* Update another field of server configuration */</span>
  1164. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_cfgupdate&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Signon test&#39;</span><span class="p">];</span>
  1165. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_HMAC_secret&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">hash</span><span class="p">(</span><span class="s1">&#39;sha1&#39;</span><span class="p">,</span> <span class="nb">uniqid</span><span class="p">(</span><span class="nb">strval</span><span class="p">(</span><span class="nb">random_int</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">mt_getrandmax</span><span class="p">())),</span> <span class="k">true</span><span class="p">));</span>
  1166. <span class="nv">$id</span> <span class="o">=</span> <span class="nb">session_id</span><span class="p">();</span>
  1167. <span class="cm">/* Close that session */</span>
  1168. <span class="o">@</span><span class="nb">session_write_close</span><span class="p">();</span>
  1169. <span class="cm">/* Redirect to phpMyAdmin (should use absolute URL here!) */</span>
  1170. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Location: ../index.php&#39;</span><span class="p">);</span>
  1171. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1172. <span class="cm">/* Show simple form */</span>
  1173. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Content-Type: text/html; charset=utf-8&#39;</span><span class="p">);</span>
  1174. <span class="k">echo</span> <span class="s1">&#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&#39;</span> <span class="o">.</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1175. <span class="k">echo</span> <span class="s1">&#39;&lt;!DOCTYPE HTML&gt;</span>
  1176. <span class="s1">&lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;</span>
  1177. <span class="s1">&lt;head&gt;</span>
  1178. <span class="s1">&lt;link rel=&quot;icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;</span>
  1179. <span class="s1">&lt;link rel=&quot;shortcut icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;</span>
  1180. <span class="s1">&lt;meta charset=&quot;utf-8&quot;&gt;</span>
  1181. <span class="s1">&lt;title&gt;phpMyAdmin single signon example&lt;/title&gt;</span>
  1182. <span class="s1">&lt;/head&gt;</span>
  1183. <span class="s1">&lt;body&gt;&#39;</span><span class="p">;</span>
  1184. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1185. <span class="k">echo</span> <span class="s1">&#39;&lt;p class=&quot;error&quot;&gt;&#39;</span><span class="p">;</span>
  1186. <span class="k">echo</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">];</span>
  1187. <span class="k">echo</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">;</span>
  1188. <span class="p">}</span>
  1189. <span class="k">echo</span> <span class="s1">&#39;&lt;form action=&quot;signon.php&quot; method=&quot;post&quot;&gt;</span>
  1190. <span class="s1">Username: &lt;input type=&quot;text&quot; name=&quot;user&quot; autocomplete=&quot;username&quot; spellcheck=&quot;false&quot;&gt;&lt;br&gt;</span>
  1191. <span class="s1">Password: &lt;input type=&quot;password&quot; name=&quot;password&quot; autocomplete=&quot;current-password&quot; spellcheck=&quot;false&quot;&gt;&lt;br&gt;</span>
  1192. <span class="s1">Host: (will use the one from config.inc.php by default)</span>
  1193. <span class="s1">&lt;input type=&quot;text&quot; name=&quot;host&quot;&gt;&lt;br&gt;</span>
  1194. <span class="s1">Port: (will use the one from config.inc.php by default)</span>
  1195. <span class="s1">&lt;input type=&quot;text&quot; name=&quot;port&quot;&gt;&lt;br&gt;</span>
  1196. <span class="s1">&lt;input type=&quot;submit&quot;&gt;</span>
  1197. <span class="s1">&lt;/form&gt;</span>
  1198. <span class="s1">&lt;/body&gt;</span>
  1199. <span class="s1">&lt;/html&gt;&#39;</span><span class="p">;</span>
  1200. <span class="p">}</span>
  1201. </pre></div>
  1202. </div>
  1203. <p>Alternatively, you can also use this way to integrate with OpenID as shown
  1204. in <code class="file docutils literal notranslate"><span class="pre">examples/openid.php</span></code>:</p>
  1205. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  1206. <span class="sd">/**</span>
  1207. <span class="sd"> * Single signon for phpMyAdmin using OpenID</span>
  1208. <span class="sd"> *</span>
  1209. <span class="sd"> * This is just example how to use single signon with phpMyAdmin, it is</span>
  1210. <span class="sd"> * not intended to be perfect code and look, only shows how you can</span>
  1211. <span class="sd"> * integrate this functionality in your application.</span>
  1212. <span class="sd"> *</span>
  1213. <span class="sd"> * It uses OpenID pear package, see https://pear.php.net/package/OpenID</span>
  1214. <span class="sd"> *</span>
  1215. <span class="sd"> * User first authenticates using OpenID and based on content of $AUTH_MAP</span>
  1216. <span class="sd"> * the login information is passed to phpMyAdmin in session data.</span>
  1217. <span class="sd"> */</span>
  1218. <span class="k">declare</span><span class="p">(</span><span class="nx">strict_types</span><span class="o">=</span><span class="mi">1</span><span class="p">);</span>
  1219. <span class="k">if</span> <span class="p">(</span><span class="k">false</span> <span class="o">===</span> <span class="o">@</span><span class="k">include_once</span> <span class="s1">&#39;OpenID/RelyingParty.php&#39;</span><span class="p">)</span> <span class="p">{</span>
  1220. <span class="k">exit</span><span class="p">;</span>
  1221. <span class="p">}</span>
  1222. <span class="cm">/* Change this to true if using phpMyAdmin over https */</span>
  1223. <span class="nv">$secure_cookie</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
  1224. <span class="sd">/**</span>
  1225. <span class="sd"> * Map of authenticated users to MySQL user/password pairs.</span>
  1226. <span class="sd"> */</span>
  1227. <span class="nv">$AUTH_MAP</span> <span class="o">=</span> <span class="p">[</span>
  1228. <span class="s1">&#39;https://launchpad.net/~username&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
  1229. <span class="s1">&#39;user&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;root&#39;</span><span class="p">,</span>
  1230. <span class="s1">&#39;password&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
  1231. <span class="p">],</span>
  1232. <span class="p">];</span>
  1233. <span class="c1">// phpcs:disable PSR1.Files.SideEffects,Squiz.Functions.GlobalFunction</span>
  1234. <span class="sd">/**</span>
  1235. <span class="sd"> * Simple function to show HTML page with given content.</span>
  1236. <span class="sd"> *</span>
  1237. <span class="sd"> * @param string $contents Content to include in page</span>
  1238. <span class="sd"> */</span>
  1239. <span class="k">function</span> <span class="nf">Show_page</span><span class="p">(</span><span class="nv">$contents</span><span class="p">)</span><span class="o">:</span> <span class="nx">void</span>
  1240. <span class="p">{</span>
  1241. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Content-Type: text/html; charset=utf-8&#39;</span><span class="p">);</span>
  1242. <span class="k">echo</span> <span class="s1">&#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&#39;</span> <span class="o">.</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1243. <span class="k">echo</span> <span class="s1">&#39;&lt;!DOCTYPE HTML&gt;</span>
  1244. <span class="s1">&lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;</span>
  1245. <span class="s1">&lt;head&gt;</span>
  1246. <span class="s1">&lt;link rel=&quot;icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;</span>
  1247. <span class="s1">&lt;link rel=&quot;shortcut icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;</span>
  1248. <span class="s1">&lt;meta charset=&quot;utf-8&quot;&gt;</span>
  1249. <span class="s1">&lt;title&gt;phpMyAdmin OpenID signon example&lt;/title&gt;</span>
  1250. <span class="s1">&lt;/head&gt;</span>
  1251. <span class="s1">&lt;body&gt;&#39;</span><span class="p">;</span>
  1252. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1253. <span class="k">echo</span> <span class="s1">&#39;&lt;p class=&quot;error&quot;&gt;&#39;</span> <span class="o">.</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_message&#39;</span><span class="p">]</span> <span class="o">.</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">;</span>
  1254. <span class="nb">unset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_message&#39;</span><span class="p">]);</span>
  1255. <span class="p">}</span>
  1256. <span class="k">echo</span> <span class="nv">$contents</span><span class="p">;</span>
  1257. <span class="k">echo</span> <span class="s1">&#39;&lt;/body&gt;&lt;/html&gt;&#39;</span><span class="p">;</span>
  1258. <span class="p">}</span>
  1259. <span class="sd">/**</span>
  1260. <span class="sd"> * Display error and exit</span>
  1261. <span class="sd"> *</span>
  1262. <span class="sd"> * @param Exception $e Exception object</span>
  1263. <span class="sd"> */</span>
  1264. <span class="k">function</span> <span class="nf">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">)</span><span class="o">:</span> <span class="nx">void</span>
  1265. <span class="p">{</span>
  1266. <span class="nv">$contents</span> <span class="o">=</span> <span class="s2">&quot;&lt;div class=&#39;relyingparty_results&#39;&gt;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1267. <span class="nv">$contents</span> <span class="o">.=</span> <span class="s1">&#39;&lt;pre&gt;&#39;</span> <span class="o">.</span> <span class="nb">htmlspecialchars</span><span class="p">(</span><span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getMessage</span><span class="p">())</span> <span class="o">.</span> <span class="s2">&quot;&lt;/pre&gt;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1268. <span class="nv">$contents</span> <span class="o">.=</span> <span class="s2">&quot;&lt;/div class=&#39;relyingparty_results&#39;&gt;&quot;</span><span class="p">;</span>
  1269. <span class="nx">Show_page</span><span class="p">(</span><span class="nv">$contents</span><span class="p">);</span>
  1270. <span class="k">exit</span><span class="p">;</span>
  1271. <span class="p">}</span>
  1272. <span class="c1">// phpcs:enable</span>
  1273. <span class="cm">/* Need to have cookie visible from parent directory */</span>
  1274. <span class="nb">session_set_cookie_params</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$secure_cookie</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
  1275. <span class="cm">/* Create signon session */</span>
  1276. <span class="nv">$session_name</span> <span class="o">=</span> <span class="s1">&#39;SignonSession&#39;</span><span class="p">;</span>
  1277. <span class="nb">session_name</span><span class="p">(</span><span class="nv">$session_name</span><span class="p">);</span>
  1278. <span class="o">@</span><span class="nb">session_start</span><span class="p">();</span>
  1279. <span class="c1">// Determine realm and return_to</span>
  1280. <span class="nv">$base</span> <span class="o">=</span> <span class="s1">&#39;http&#39;</span><span class="p">;</span>
  1281. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTPS&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTPS&#39;</span><span class="p">]</span> <span class="o">===</span> <span class="s1">&#39;on&#39;</span><span class="p">)</span> <span class="p">{</span>
  1282. <span class="nv">$base</span> <span class="o">.=</span> <span class="s1">&#39;s&#39;</span><span class="p">;</span>
  1283. <span class="p">}</span>
  1284. <span class="nv">$base</span> <span class="o">.=</span> <span class="s1">&#39;://&#39;</span> <span class="o">.</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;SERVER_NAME&#39;</span><span class="p">]</span> <span class="o">.</span> <span class="s1">&#39;:&#39;</span> <span class="o">.</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;SERVER_PORT&#39;</span><span class="p">];</span>
  1285. <span class="nv">$realm</span> <span class="o">=</span> <span class="nv">$base</span> <span class="o">.</span> <span class="s1">&#39;/&#39;</span><span class="p">;</span>
  1286. <span class="nv">$returnTo</span> <span class="o">=</span> <span class="nv">$base</span> <span class="o">.</span> <span class="nb">dirname</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;PHP_SELF&#39;</span><span class="p">]);</span>
  1287. <span class="k">if</span> <span class="p">(</span><span class="nv">$returnTo</span><span class="p">[</span><span class="nb">strlen</span><span class="p">(</span><span class="nv">$returnTo</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">!==</span> <span class="s1">&#39;/&#39;</span><span class="p">)</span> <span class="p">{</span>
  1288. <span class="nv">$returnTo</span> <span class="o">.=</span> <span class="s1">&#39;/&#39;</span><span class="p">;</span>
  1289. <span class="p">}</span>
  1290. <span class="nv">$returnTo</span> <span class="o">.=</span> <span class="s1">&#39;openid.php&#39;</span><span class="p">;</span>
  1291. <span class="cm">/* Display form */</span>
  1292. <span class="k">if</span> <span class="p">((</span><span class="o">!</span> <span class="nb">count</span><span class="p">(</span><span class="nv">$_GET</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="nb">count</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">))</span> <span class="o">||</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$_GET</span><span class="p">[</span><span class="s1">&#39;phpMyAdmin&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1293. <span class="cm">/* Show simple form */</span>
  1294. <span class="nv">$content</span> <span class="o">=</span> <span class="s1">&#39;&lt;form action=&quot;openid.php&quot; method=&quot;post&quot;&gt;</span>
  1295. <span class="s1">OpenID: &lt;input type=&quot;text&quot; name=&quot;identifier&quot;&gt;&lt;br&gt;</span>
  1296. <span class="s1">&lt;input type=&quot;submit&quot; name=&quot;start&quot;&gt;</span>
  1297. <span class="s1">&lt;/form&gt;&#39;</span><span class="p">;</span>
  1298. <span class="nx">Show_page</span><span class="p">(</span><span class="nv">$content</span><span class="p">);</span>
  1299. <span class="k">exit</span><span class="p">;</span>
  1300. <span class="p">}</span>
  1301. <span class="cm">/* Grab identifier */</span>
  1302. <span class="nv">$identifier</span> <span class="o">=</span> <span class="k">null</span><span class="p">;</span>
  1303. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nb">is_string</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1304. <span class="nv">$identifier</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">];</span>
  1305. <span class="p">}</span> <span class="k">elseif</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nb">is_string</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1306. <span class="nv">$identifier</span> <span class="o">=</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">];</span>
  1307. <span class="p">}</span>
  1308. <span class="cm">/* Create OpenID object */</span>
  1309. <span class="k">try</span> <span class="p">{</span>
  1310. <span class="nv">$o</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenID_RelyingParty</span><span class="p">(</span><span class="nv">$returnTo</span><span class="p">,</span> <span class="nv">$realm</span><span class="p">,</span> <span class="nv">$identifier</span><span class="p">);</span>
  1311. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Throwable</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1312. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1313. <span class="p">}</span>
  1314. <span class="cm">/* Redirect to OpenID provider */</span>
  1315. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;start&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1316. <span class="k">try</span> <span class="p">{</span>
  1317. <span class="nv">$authRequest</span> <span class="o">=</span> <span class="nv">$o</span><span class="o">-&gt;</span><span class="na">prepare</span><span class="p">();</span>
  1318. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Throwable</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1319. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1320. <span class="p">}</span>
  1321. <span class="nv">$url</span> <span class="o">=</span> <span class="nv">$authRequest</span><span class="o">-&gt;</span><span class="na">getAuthorizeURL</span><span class="p">();</span>
  1322. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Location: &#39;</span> <span class="o">.</span> <span class="nv">$url</span><span class="p">);</span>
  1323. <span class="k">exit</span><span class="p">;</span>
  1324. <span class="p">}</span>
  1325. <span class="cm">/* Grab query string */</span>
  1326. <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="nb">count</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">))</span> <span class="p">{</span>
  1327. <span class="p">[,</span> <span class="nv">$queryString</span><span class="p">]</span> <span class="o">=</span> <span class="nb">explode</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">,</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;REQUEST_URI&#39;</span><span class="p">]);</span>
  1328. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1329. <span class="c1">// Fetch the raw query body</span>
  1330. <span class="nv">$queryString</span> <span class="o">=</span> <span class="nb">file_get_contents</span><span class="p">(</span><span class="s1">&#39;php://input&#39;</span><span class="p">);</span>
  1331. <span class="p">}</span>
  1332. <span class="cm">/* Check reply */</span>
  1333. <span class="k">try</span> <span class="p">{</span>
  1334. <span class="nv">$message</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenID_Message</span><span class="p">(</span><span class="nv">$queryString</span><span class="p">,</span> <span class="nx">OpenID_Message</span><span class="o">::</span><span class="na">FORMAT_HTTP</span><span class="p">);</span>
  1335. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Throwable</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1336. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1337. <span class="p">}</span>
  1338. <span class="nv">$id</span> <span class="o">=</span> <span class="nv">$message</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;openid.claimed_id&#39;</span><span class="p">);</span>
  1339. <span class="k">if</span> <span class="p">(</span><span class="k">empty</span><span class="p">(</span><span class="nv">$id</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">]))</span> <span class="p">{</span>
  1340. <span class="nx">Show_page</span><span class="p">(</span><span class="s1">&#39;&lt;p&gt;User not allowed!&lt;/p&gt;&#39;</span><span class="p">);</span>
  1341. <span class="k">exit</span><span class="p">;</span>
  1342. <span class="p">}</span>
  1343. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">][</span><span class="s1">&#39;user&#39;</span><span class="p">];</span>
  1344. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">][</span><span class="s1">&#39;password&#39;</span><span class="p">];</span>
  1345. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_HMAC_secret&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">hash</span><span class="p">(</span><span class="s1">&#39;sha1&#39;</span><span class="p">,</span> <span class="nb">uniqid</span><span class="p">(</span><span class="nb">strval</span><span class="p">(</span><span class="nb">random_int</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">mt_getrandmax</span><span class="p">())),</span> <span class="k">true</span><span class="p">));</span>
  1346. <span class="nb">session_write_close</span><span class="p">();</span>
  1347. <span class="cm">/* Redirect to phpMyAdmin (should use absolute URL here!) */</span>
  1348. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Location: ../index.php&#39;</span><span class="p">);</span>
  1349. </pre></div>
  1350. </div>
  1351. <p>If you intend to pass the credentials using some other means than, you have to
  1352. implement wrapper in PHP to get that data and set it to
  1353. <span class="target" id="index-50"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>. There is a very minimal example
  1354. in <code class="file docutils literal notranslate"><span class="pre">examples/signon-script.php</span></code>:</p>
  1355. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  1356. <span class="sd">/**</span>
  1357. <span class="sd"> * Single signon for phpMyAdmin</span>
  1358. <span class="sd"> *</span>
  1359. <span class="sd"> * This is just example how to use script based single signon with</span>
  1360. <span class="sd"> * phpMyAdmin, it is not intended to be perfect code and look, only</span>
  1361. <span class="sd"> * shows how you can integrate this functionality in your application.</span>
  1362. <span class="sd"> */</span>
  1363. <span class="k">declare</span><span class="p">(</span><span class="nx">strict_types</span><span class="o">=</span><span class="mi">1</span><span class="p">);</span>
  1364. <span class="c1">// phpcs:disable Squiz.Functions.GlobalFunction</span>
  1365. <span class="sd">/**</span>
  1366. <span class="sd"> * This function returns username and password.</span>
  1367. <span class="sd"> *</span>
  1368. <span class="sd"> * It can optionally use configured username as parameter.</span>
  1369. <span class="sd"> *</span>
  1370. <span class="sd"> * @param string $user User name</span>
  1371. <span class="sd"> *</span>
  1372. <span class="sd"> * @return array</span>
  1373. <span class="sd"> */</span>
  1374. <span class="k">function</span> <span class="nf">get_login_credentials</span><span class="p">(</span><span class="nv">$user</span><span class="p">)</span>
  1375. <span class="p">{</span>
  1376. <span class="cm">/* Optionally we can use passed username */</span>
  1377. <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="k">empty</span><span class="p">(</span><span class="nv">$user</span><span class="p">))</span> <span class="p">{</span>
  1378. <span class="k">return</span> <span class="p">[</span>
  1379. <span class="nv">$user</span><span class="p">,</span>
  1380. <span class="s1">&#39;password&#39;</span><span class="p">,</span>
  1381. <span class="p">];</span>
  1382. <span class="p">}</span>
  1383. <span class="cm">/* Here we would retrieve the credentials */</span>
  1384. <span class="k">return</span> <span class="p">[</span>
  1385. <span class="s1">&#39;root&#39;</span><span class="p">,</span>
  1386. <span class="s1">&#39;&#39;</span><span class="p">,</span>
  1387. <span class="p">];</span>
  1388. <span class="p">}</span>
  1389. </pre></div>
  1390. </div>
  1391. <div class="admonition seealso">
  1392. <p class="admonition-title">See also</p>
  1393. <p><span class="target" id="index-51"></span><a class="reference internal" href="config.html#cfg_Servers_auth_type"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['auth_type']</span></code></a>,
  1394. <span class="target" id="index-52"></span><a class="reference internal" href="config.html#cfg_Servers_SignonSession"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonSession']</span></code></a>,
  1395. <span class="target" id="index-53"></span><a class="reference internal" href="config.html#cfg_Servers_SignonCookieParams"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonCookieParams']</span></code></a>,
  1396. <span class="target" id="index-54"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>,
  1397. <span class="target" id="index-55"></span><a class="reference internal" href="config.html#cfg_Servers_SignonURL"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['SignonURL']</span></code></a>,
  1398. <a class="reference internal" href="config.html#example-signon"><span class="std std-ref">Example for signon authentication</span></a></p>
  1399. </div>
  1400. </section>
  1401. <section id="config-authentication-mode">
  1402. <span id="auth-config"></span><span id="index-56"></span><h3>Config authentication mode<a class="headerlink" href="#config-authentication-mode" title="Permalink to this heading">¶</a></h3>
  1403. <ul class="simple">
  1404. <li><p>This mode is sometimes the less secure one because it requires you to fill the
  1405. <span class="target" id="index-57"></span><a class="reference internal" href="config.html#cfg_Servers_user"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['user']</span></code></a> and
  1406. <span class="target" id="index-58"></span><a class="reference internal" href="config.html#cfg_Servers_password"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['password']</span></code></a>
  1407. fields (and as a result, anyone who can read your <code class="file docutils literal notranslate"><span class="pre">config.inc.php</span></code>
  1408. can discover your username and password).</p></li>
  1409. <li><p>In the <a class="reference internal" href="faq.html#faqmultiuser"><span class="std std-ref">ISPs, multi-user installations</span></a> section, there is an entry explaining how
  1410. to protect your configuration file.</p></li>
  1411. <li><p>For additional security in this mode, you may wish to consider the
  1412. Host authentication <span class="target" id="index-59"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_order"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['order']</span></code></a>
  1413. and <span class="target" id="index-60"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></code></a> configuration directives.</p></li>
  1414. <li><p>Unlike cookie and http, does not require a user to log in when first
  1415. loading the phpMyAdmin site. This is by design but could allow any
  1416. user to access your installation. Use of some restriction method is
  1417. suggested, perhaps a <a class="reference internal" href="glossary.html#term-.htaccess"><span class="xref std std-term">.htaccess</span></a> file with the HTTP-AUTH directive or disallowing
  1418. incoming HTTP requests at one’s router or firewall will suffice (both
  1419. of which are beyond the scope of this manual but easily searchable
  1420. with Google).</p></li>
  1421. </ul>
  1422. </section>
  1423. </section>
  1424. <section id="securing-your-phpmyadmin-installation">
  1425. <span id="securing"></span><h2>Securing your phpMyAdmin installation<a class="headerlink" href="#securing-your-phpmyadmin-installation" title="Permalink to this heading">¶</a></h2>
  1426. <p>The phpMyAdmin team tries hard to make the application secure, however there
  1427. are always ways to make your installation more secure:</p>
  1428. <ul>
  1429. <li><p>Follow our <a class="reference external" href="https://www.phpmyadmin.net/security/">Security announcements</a> and upgrade
  1430. phpMyAdmin whenever new vulnerability is published.</p></li>
  1431. <li><p>Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that
  1432. you’re protected from protocol downgrade attacks.</p></li>
  1433. <li><p>Ensure your PHP setup follows recommendations for production sites, for example
  1434. <a class="reference external" href="https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors">display_errors</a>
  1435. should be disabled.</p></li>
  1436. <li><p>Remove the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory from phpMyAdmin, unless you are developing and need a test suite.</p></li>
  1437. <li><p>Remove the <code class="docutils literal notranslate"><span class="pre">setup</span></code> directory from phpMyAdmin, you will probably not
  1438. use it after the initial setup.</p></li>
  1439. <li><p>Properly choose an authentication method - <a class="reference internal" href="#cookie"><span class="std std-ref">Cookie authentication mode</span></a>
  1440. is probably the best choice for shared hosting.</p></li>
  1441. <li><p>Deny access to auxiliary files in <code class="file docutils literal notranslate"><span class="pre">./libraries/</span></code> or
  1442. <code class="file docutils literal notranslate"><span class="pre">./templates/</span></code> subfolders in your webserver configuration.
  1443. Such configuration prevents from possible path exposure and cross side
  1444. scripting vulnerabilities that might happen to be found in that code. For the
  1445. Apache webserver, this is often accomplished with a <a class="reference internal" href="glossary.html#term-.htaccess"><span class="xref std std-term">.htaccess</span></a> file in
  1446. those directories.</p></li>
  1447. <li><p>Deny access to temporary files, see <span class="target" id="index-61"></span><a class="reference internal" href="config.html#cfg_TempDir"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['TempDir']</span></code></a> (if that
  1448. is placed inside your web root, see also <a class="reference internal" href="config.html#web-dirs"><span class="std std-ref">Web server upload/save/import directories</span></a>.</p></li>
  1449. <li><p>It is generally a good idea to protect a public phpMyAdmin installation
  1450. against access by robots as they usually can not do anything good there. You
  1451. can do this using <code class="docutils literal notranslate"><span class="pre">robots.txt</span></code> file in the root of your webserver or limit
  1452. access by web server configuration, see <a class="reference internal" href="faq.html#faq1-42"><span class="std std-ref">1.42 How can I prevent robots from accessing phpMyAdmin?</span></a>.</p></li>
  1453. <li><p>In case you don’t want all MySQL users to be able to access
  1454. phpMyAdmin, you can use <span class="target" id="index-62"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></code></a> to limit them
  1455. or <span class="target" id="index-63"></span><a class="reference internal" href="config.html#cfg_Servers_AllowRoot"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['AllowRoot']</span></code></a> to deny root user access.</p></li>
  1456. <li><p>Enable <a class="reference internal" href="two_factor.html#fa"><span class="std std-ref">Two-factor authentication</span></a> for your account.</p></li>
  1457. <li><p>Consider hiding phpMyAdmin behind an authentication proxy, so that
  1458. users need to authenticate prior to providing MySQL credentials
  1459. to phpMyAdmin. You can achieve this by configuring your web server to request
  1460. HTTP authentication. For example in Apache this can be done with:</p>
  1461. <div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nb">AuthType</span><span class="w"> </span>Basic
  1462. <span class="nb">AuthName</span><span class="w"> </span><span class="s2">&quot;Restricted Access&quot;</span>
  1463. <span class="nb">AuthUserFile</span><span class="w"> </span><span class="sx">/usr/share/phpmyadmin/passwd</span>
  1464. <span class="nb">Require</span><span class="w"> </span>valid-user
  1465. </pre></div>
  1466. </div>
  1467. <p>Once you have changed the configuration, you need to create a list of users which
  1468. can authenticate. This can be done using the <strong class="program">htpasswd</strong> utility:</p>
  1469. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>htpasswd<span class="w"> </span>-c<span class="w"> </span>/usr/share/phpmyadmin/passwd<span class="w"> </span>username
  1470. </pre></div>
  1471. </div>
  1472. </li>
  1473. <li><p>If you are afraid of automated attacks, enabling Captcha by
  1474. <span class="target" id="index-64"></span><a class="reference internal" href="config.html#cfg_CaptchaLoginPublicKey"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['CaptchaLoginPublicKey']</span></code></a> and
  1475. <span class="target" id="index-65"></span><a class="reference internal" href="config.html#cfg_CaptchaLoginPrivateKey"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['CaptchaLoginPrivateKey']</span></code></a> might be an option.</p></li>
  1476. <li><p>Failed login attempts are logged to syslog (if available, see
  1477. <span class="target" id="index-66"></span><a class="reference internal" href="config.html#cfg_AuthLog"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['AuthLog']</span></code></a>). This can allow using a tool such as
  1478. fail2ban to block brute-force attempts. Note that the log file used by syslog
  1479. is not the same as the Apache error or access log files.</p></li>
  1480. <li><p>In case you’re running phpMyAdmin together with other PHP applications, it is
  1481. generally advised to use separate session storage for phpMyAdmin to avoid
  1482. possible session-based attacks against it. You can use
  1483. <span class="target" id="index-67"></span><a class="reference internal" href="config.html#cfg_SessionSavePath"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['SessionSavePath']</span></code></a> to achieve this.</p></li>
  1484. </ul>
  1485. </section>
  1486. <section id="using-ssl-for-connection-to-database-server">
  1487. <span id="ssl"></span><h2>Using SSL for connection to database server<a class="headerlink" href="#using-ssl-for-connection-to-database-server" title="Permalink to this heading">¶</a></h2>
  1488. <p>It is recommended to use SSL when connecting to remote database server. There
  1489. are several configuration options involved in the SSL setup:</p>
  1490. <dl class="simple">
  1491. <dt><span class="target" id="index-68"></span><a class="reference internal" href="config.html#cfg_Servers_ssl"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl']</span></code></a></dt><dd><p>Defines whether to use SSL at all. If you enable only this, the connection
  1492. will be encrypted, but there is not authentication of the connection - you
  1493. can not verify that you are talking to the right server.</p>
  1494. </dd>
  1495. <dt><span class="target" id="index-69"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a> and <span class="target" id="index-70"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a></dt><dd><p>This is used for authentication of client to the server.</p>
  1496. </dd>
  1497. <dt><span class="target" id="index-71"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a> and <span class="target" id="index-72"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca_path"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca_path']</span></code></a></dt><dd><p>The certificate authorities you trust for server certificates.
  1498. This is used to ensure that you are talking to a trusted server.</p>
  1499. </dd>
  1500. <dt><span class="target" id="index-73"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></dt><dd><p>This configuration disables server certificate verification. Use with
  1501. caution.</p>
  1502. </dd>
  1503. </dl>
  1504. <p>When the database server is using a local connection or private network and SSL can not be configured
  1505. you can use <span class="target" id="index-74"></span><a class="reference internal" href="config.html#cfg_MysqlSslWarningSafeHosts"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['MysqlSslWarningSafeHosts']</span></code></a> to explicitly list the hostnames that are considered secure.</p>
  1506. <div class="admonition seealso">
  1507. <p class="admonition-title">See also</p>
  1508. <p><a class="reference internal" href="config.html#example-google-ssl"><span class="std std-ref">Google Cloud SQL with SSL</span></a>,
  1509. <a class="reference internal" href="config.html#example-aws-ssl"><span class="std std-ref">Amazon RDS Aurora with SSL</span></a>,
  1510. <span class="target" id="index-75"></span><a class="reference internal" href="config.html#cfg_Servers_ssl"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl']</span></code></a>,
  1511. <span class="target" id="index-76"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a>,
  1512. <span class="target" id="index-77"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a>,
  1513. <span class="target" id="index-78"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a>,
  1514. <span class="target" id="index-79"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca_path"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ca_path']</span></code></a>,
  1515. <span class="target" id="index-80"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ciphers"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_ciphers']</span></code></a>,
  1516. <span class="target" id="index-81"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal notranslate"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></p>
  1517. </div>
  1518. </section>
  1519. <section id="known-issues">
  1520. <h2>Known issues<a class="headerlink" href="#known-issues" title="Permalink to this heading">¶</a></h2>
  1521. <section id="users-with-column-specific-privileges-are-unable-to-browse">
  1522. <h3>Users with column-specific privileges are unable to “Browse”<a class="headerlink" href="#users-with-column-specific-privileges-are-unable-to-browse" title="Permalink to this heading">¶</a></h3>
  1523. <p>If a user has only column-specific privileges on some (but not all) columns in a table, “Browse”
  1524. will fail with an error message.</p>
  1525. <p>As a workaround, a bookmarked query with the same name as the table can be created, this will
  1526. run when using the “Browse” link instead. <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/issues/11922">Issue 11922</a>.</p>
  1527. </section>
  1528. <section id="trouble-logging-back-in-after-logging-out-using-http-authentication">
  1529. <h3>Trouble logging back in after logging out using ‘http’ authentication<a class="headerlink" href="#trouble-logging-back-in-after-logging-out-using-http-authentication" title="Permalink to this heading">¶</a></h3>
  1530. <p>When using the ‘http’ <code class="docutils literal notranslate"><span class="pre">auth_type</span></code>, it can be impossible to log back in (when the logout comes
  1531. manually or after a period of inactivity). <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/issues/11898">Issue 11898</a>.</p>
  1532. </section>
  1533. </section>
  1534. </section>
  1535. <div class="clearer"></div>
  1536. </div>
  1537. </div>
  1538. </div>
  1539. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  1540. <div class="sphinxsidebarwrapper">
  1541. <div>
  1542. <h3><a href="index.html">Table of Contents</a></h3>
  1543. <ul>
  1544. <li><a class="reference internal" href="#">Installation</a><ul>
  1545. <li><a class="reference internal" href="#linux-distributions">Linux distributions</a><ul>
  1546. <li><a class="reference internal" href="#debian-and-ubuntu">Debian and Ubuntu</a></li>
  1547. <li><a class="reference internal" href="#opensuse">OpenSUSE</a></li>
  1548. <li><a class="reference internal" href="#gentoo">Gentoo</a></li>
  1549. <li><a class="reference internal" href="#mandriva">Mandriva</a></li>
  1550. <li><a class="reference internal" href="#fedora">Fedora</a></li>
  1551. <li><a class="reference internal" href="#red-hat-enterprise-linux">Red Hat Enterprise Linux</a></li>
  1552. </ul>
  1553. </li>
  1554. <li><a class="reference internal" href="#installing-on-windows">Installing on Windows</a></li>
  1555. <li><a class="reference internal" href="#installing-from-git">Installing from Git</a></li>
  1556. <li><a class="reference internal" href="#installing-using-composer">Installing using Composer</a></li>
  1557. <li><a class="reference internal" href="#installing-using-docker">Installing using Docker</a><ul>
  1558. <li><a class="reference internal" href="#docker-environment-variables">Docker environment variables</a></li>
  1559. <li><a class="reference internal" href="#customizing-configuration">Customizing configuration</a></li>
  1560. <li><a class="reference internal" href="#docker-volumes">Docker Volumes</a></li>
  1561. <li><a class="reference internal" href="#docker-examples">Docker Examples</a></li>
  1562. <li><a class="reference internal" href="#using-docker-compose">Using docker-compose</a></li>
  1563. <li><a class="reference internal" href="#customizing-configuration-file-using-docker-compose">Customizing configuration file using docker-compose</a></li>
  1564. <li><a class="reference internal" href="#running-behind-haproxy-in-a-subdirectory">Running behind haproxy in a subdirectory</a></li>
  1565. </ul>
  1566. </li>
  1567. <li><a class="reference internal" href="#ibm-cloud">IBM Cloud</a></li>
  1568. <li><a class="reference internal" href="#quick-install">Quick Install</a><ul>
  1569. <li><a class="reference internal" href="#manually-creating-the-file">Manually creating the file</a></li>
  1570. <li><a class="reference internal" href="#using-the-setup-script">Using the Setup script</a><ul>
  1571. <li><a class="reference internal" href="#setup-script-on-debian-ubuntu-and-derivatives">Setup script on Debian, Ubuntu and derivatives</a></li>
  1572. <li><a class="reference internal" href="#setup-script-on-opensuse">Setup script on openSUSE</a></li>
  1573. </ul>
  1574. </li>
  1575. </ul>
  1576. </li>
  1577. <li><a class="reference internal" href="#verifying-phpmyadmin-releases">Verifying phpMyAdmin releases</a></li>
  1578. <li><a class="reference internal" href="#phpmyadmin-configuration-storage">phpMyAdmin configuration storage</a><ul>
  1579. <li><a class="reference internal" href="#zero-configuration">Zero configuration</a></li>
  1580. <li><a class="reference internal" href="#manual-configuration">Manual configuration</a></li>
  1581. </ul>
  1582. </li>
  1583. <li><a class="reference internal" href="#upgrading-from-an-older-version">Upgrading from an older version</a></li>
  1584. <li><a class="reference internal" href="#using-authentication-modes">Using authentication modes</a><ul>
  1585. <li><a class="reference internal" href="#http-authentication-mode">HTTP authentication mode</a></li>
  1586. <li><a class="reference internal" href="#cookie-authentication-mode">Cookie authentication mode</a></li>
  1587. <li><a class="reference internal" href="#signon-authentication-mode">Signon authentication mode</a></li>
  1588. <li><a class="reference internal" href="#config-authentication-mode">Config authentication mode</a></li>
  1589. </ul>
  1590. </li>
  1591. <li><a class="reference internal" href="#securing-your-phpmyadmin-installation">Securing your phpMyAdmin installation</a></li>
  1592. <li><a class="reference internal" href="#using-ssl-for-connection-to-database-server">Using SSL for connection to database server</a></li>
  1593. <li><a class="reference internal" href="#known-issues">Known issues</a><ul>
  1594. <li><a class="reference internal" href="#users-with-column-specific-privileges-are-unable-to-browse">Users with column-specific privileges are unable to “Browse”</a></li>
  1595. <li><a class="reference internal" href="#trouble-logging-back-in-after-logging-out-using-http-authentication">Trouble logging back in after logging out using ‘http’ authentication</a></li>
  1596. </ul>
  1597. </li>
  1598. </ul>
  1599. </li>
  1600. </ul>
  1601. </div>
  1602. <div>
  1603. <h4>Previous topic</h4>
  1604. <p class="topless"><a href="require.html"
  1605. title="previous chapter">Requirements</a></p>
  1606. </div>
  1607. <div>
  1608. <h4>Next topic</h4>
  1609. <p class="topless"><a href="config.html"
  1610. title="next chapter">Configuration</a></p>
  1611. </div>
  1612. <div role="note" aria-label="source link">
  1613. <h3>This Page</h3>
  1614. <ul class="this-page-menu">
  1615. <li><a href="_sources/setup.rst.txt"
  1616. rel="nofollow">Show Source</a></li>
  1617. </ul>
  1618. </div>
  1619. <div id="searchbox" style="display: none" role="search">
  1620. <h3 id="searchlabel">Quick search</h3>
  1621. <div class="searchformwrapper">
  1622. <form class="search" action="search.html" method="get">
  1623. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  1624. <input type="submit" value="Go" />
  1625. </form>
  1626. </div>
  1627. </div>
  1628. <script>document.getElementById('searchbox').style.display = "block"</script>
  1629. </div>
  1630. </div>
  1631. <div class="clearer"></div>
  1632. </div>
  1633. <div class="related" role="navigation" aria-label="related navigation">
  1634. <h3>Navigation</h3>
  1635. <ul>
  1636. <li class="right" style="margin-right: 10px">
  1637. <a href="genindex.html" title="General Index"
  1638. >index</a></li>
  1639. <li class="right" >
  1640. <a href="config.html" title="Configuration"
  1641. >next</a> |</li>
  1642. <li class="right" >
  1643. <a href="require.html" title="Requirements"
  1644. >previous</a> |</li>
  1645. <li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 5.2.2 documentation</a> &#187;</li>
  1646. <li class="nav-item nav-item-this"><a href="">Installation</a></li>
  1647. </ul>
  1648. </div>
  1649. <div class="footer" role="contentinfo">
  1650. &#169; <a href="copyright.html">Copyright</a> 2012 - 2024, The phpMyAdmin devel team.
  1651. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
  1652. </div>
  1653. </body>
  1654. </html>