diff options
Diffstat (limited to 'srcs/phpmyadmin/doc/html/setup.html')
| -rw-r--r-- | srcs/phpmyadmin/doc/html/setup.html | 1471 |
1 files changed, 1471 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/doc/html/setup.html b/srcs/phpmyadmin/doc/html/setup.html new file mode 100644 index 0000000..7b51559 --- /dev/null +++ b/srcs/phpmyadmin/doc/html/setup.html @@ -0,0 +1,1471 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Installation — phpMyAdmin 5.0.1 documentation</title> + + <link rel="stylesheet" href="_static/classic.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: './', + VERSION: '5.0.1', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="index" title="Index" href="genindex.html" /> + <link rel="search" title="Search" href="search.html" /> + <link rel="copyright" title="Copyright" href="copyright.html" /> + <link rel="top" title="phpMyAdmin 5.0.1 documentation" href="index.html" /> + <link rel="next" title="Configuration" href="config.html" /> + <link rel="prev" title="Requirements" href="require.html" /> + </head> + <body role="document"> + <div class="related" role="navigation" aria-label="related navigation"> + <h3>Navigation</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="genindex.html" title="General Index" + accesskey="I">index</a></li> + <li class="right" > + <a href="config.html" title="Configuration" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="require.html" title="Requirements" + accesskey="P">previous</a> |</li> + <li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 5.0.1 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="installation"> +<span id="setup"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1> +<p>phpMyAdmin does not apply any special security methods to the MySQL +database server. It is still the system administrator’s job to grant +permissions on the MySQL databases properly. phpMyAdmin’s <span class="guilabel">Users</span> +page can be used for this.</p> +<div class="admonition warning"> +<p class="first admonition-title">Warning</p> +<p class="last"><a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a> users should note that if you are on a version before +<a class="reference internal" href="glossary.html#term-mac-os-x"><span class="xref std std-term">Mac OS X</span></a>, StuffIt unstuffs with <a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a> formats. So you’ll have +to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before +uploading them to your server, as PHP seems not to like <a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a>-style +end of lines character (“<code class="docutils literal"><span class="pre">\r</span></code>”).</p> +</div> +<div class="section" id="linux-distributions"> +<h2>Linux distributions<a class="headerlink" href="#linux-distributions" title="Permalink to this headline">¶</a></h2> +<p>phpMyAdmin is included in most Linux distributions. It is recommended to use +distribution packages when possible - they usually provide integration to your +distribution and you will automatically get security updates from your distribution.</p> +<div class="section" id="debian-and-ubuntu"> +<span id="debian-package"></span><h3>Debian and Ubuntu<a class="headerlink" href="#debian-and-ubuntu" title="Permalink to this headline">¶</a></h3> +<p>Debian’s package repositories include a phpMyAdmin package, but be aware that +the configuration file is maintained in <code class="docutils literal"><span class="pre">/etc/phpmyadmin</span></code> and may differ in +some ways from the official phpMyAdmin documentation. Specifically, it does:</p> +<ul class="simple"> +<li>Configuration of a web server (works for Apache and lighttpd).</li> +<li>Creating of <a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> using dbconfig-common.</li> +<li>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>.</li> +</ul> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last">More information can be found in <a class="reference external" href="https://salsa.debian.org/phpmyadmin-team/phpmyadmin/blob/master/debian/README.Debian">README.Debian</a> +(it is installed as <code class="file docutils literal"><span class="pre">/usr/share/doc/phmyadmin/README.Debian</span></code> with the package).</p> +</div> +</div> +<div class="section" id="opensuse"> +<h3>OpenSUSE<a class="headerlink" href="#opensuse" title="Permalink to this headline">¶</a></h3> +<p>OpenSUSE already comes with phpMyAdmin package, just install packages from +the <a class="reference external" href="https://software.opensuse.org/package/phpMyAdmin">openSUSE Build Service</a>.</p> +</div> +<div class="section" id="gentoo"> +<h3>Gentoo<a class="headerlink" href="#gentoo" title="Permalink to this headline">¶</a></h3> +<p>Gentoo ships the phpMyAdmin package, both in a near-stock configuration as well +as in a <code class="docutils literal"><span class="pre">webapp-config</span></code> configuration. Use <code class="docutils literal"><span class="pre">emerge</span> <span class="pre">dev-db/phpmyadmin</span></code> to +install.</p> +</div> +<div class="section" id="mandriva"> +<h3>Mandriva<a class="headerlink" href="#mandriva" title="Permalink to this headline">¶</a></h3> +<p>Mandriva ships the phpMyAdmin package in their <code class="docutils literal"><span class="pre">contrib</span></code> branch and can be +installed via the usual Control Center.</p> +</div> +<div class="section" id="fedora"> +<h3>Fedora<a class="headerlink" href="#fedora" title="Permalink to this headline">¶</a></h3> +<p>Fedora ships the phpMyAdmin package, but be aware that the configuration file +is maintained in <code class="docutils literal"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the +official phpMyAdmin documentation.</p> +</div> +<div class="section" id="red-hat-enterprise-linux"> +<h3>Red Hat Enterprise Linux<a class="headerlink" href="#red-hat-enterprise-linux" title="Permalink to this headline">¶</a></h3> +<p>Red Hat Enterprise Linux itself and thus derivatives like CentOS don’t +ship phpMyAdmin, but the Fedora-driven repository +<a class="reference external" href="https://fedoraproject.org/wiki/EPEL">Extra Packages for Enterprise Linux (EPEL)</a> +is doing so, if it’s +<a class="reference external" href="https://fedoraproject.org/wiki/EPEL/FAQ#howtouse">enabled</a>. +But be aware that the configuration file is maintained in +<code class="docutils literal"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the +official phpMyAdmin documentation.</p> +</div> +</div> +<div class="section" id="installing-on-windows"> +<h2>Installing on Windows<a class="headerlink" href="#installing-on-windows" title="Permalink to this headline">¶</a></h2> +<p>The easiest way to get phpMyAdmin on Windows is using third party products +which include phpMyAdmin together with a database and web server such as +<a class="reference external" href="https://www.apachefriends.org/index.html">XAMPP</a>.</p> +<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> +</div> +<div class="section" id="installing-from-git"> +<h2>Installing from Git<a class="headerlink" href="#installing-from-git" title="Permalink to this headline">¶</a></h2> +<p>In order to install from Git, you’ll need a few supporting applications:</p> +<ul class="simple"> +<li><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/master">Github</a></li> +<li><a class="reference external" href="https://getcomposer.org/download/">Composer</a></li> +<li><a class="reference external" href="https://nodejs.org/en/download/">Node.js</a> (version 8 or higher)</li> +<li><a class="reference external" href="https://yarnpkg.com/lang/en/docs/install">Yarn</a></li> +</ul> +<p>You can clone current phpMyAdmin source from +<code class="docutils literal"><span class="pre">https://github.com/phpmyadmin/phpmyadmin.git</span></code>:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>git clone https://github.com/phpmyadmin/phpmyadmin.git +</pre></div> +</div> +<p>Additionally you need to install dependencies using <a class="reference external" href="https://getcomposer.org">Composer</a>:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>composer update +</pre></div> +</div> +<p>If you do not intend to develop, you can skip the installation of developer tools +by invoking:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>composer update --no-dev +</pre></div> +</div> +<p>Finally, you’ll need to use <a class="reference external" href="https://yarnpkg.com/lang/en/docs/install">Yarn</a> to install some JavaScript dependencies:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>yarn install +</pre></div> +</div> +</div> +<div class="section" id="installing-using-composer"> +<span id="composer"></span><h2>Installing using Composer<a class="headerlink" href="#installing-using-composer" title="Permalink to this headline">¶</a></h2> +<p>You can install phpMyAdmin using the <a class="reference external" href="https://getcomposer.org/">Composer tool</a>, since 4.7.0 the releases +are automatically mirrored to the default <a class="reference external" href="https://packagist.org/">Packagist</a> repository.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The content of the Composer repository is automatically generated +separately from the releases, so the content doesn’t have to be +100% same as when you download the tarball. There should be no +functional differences though.</p> +</div> +<p>To install phpMyAdmin simply run:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>composer create-project phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>Alternatively you can use our own composer repository, which contains +the release tarballs and is available at +<<a class="reference external" href="https://www.phpmyadmin.net/packages.json">https://www.phpmyadmin.net/packages.json</a>>:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>composer create-project phpmyadmin/phpmyadmin --repository-url<span class="o">=</span>https://www.phpmyadmin.net/packages.json --no-dev +</pre></div> +</div> +</div> +<div class="section" id="installing-using-docker"> +<span id="docker"></span><h2>Installing using Docker<a class="headerlink" href="#installing-using-docker" title="Permalink to this headline">¶</a></h2> +<p>phpMyAdmin comes with a <a class="reference external" href="https://hub.docker.com/r/phpmyadmin/phpmyadmin/">Docker image</a>, which you can easily deploy. You can +download it using:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker pull phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>The phpMyAdmin server will listen on port 80. It supports several ways of +configuring the link to the database server, either by Docker’s link feature +by linking your database container to <code class="docutils literal"><span class="pre">db</span></code> for phpMyAdmin (by specifying +<code class="docutils literal"><span class="pre">--link</span> <span class="pre">your_db_host:db</span></code>) or by environment variables (in this case it’s up +to you to set up networking in Docker to allow the phpMyAdmin container to access +the database container over the network).</p> +<div class="section" id="docker-environment-variables"> +<span id="docker-vars"></span><h3>Docker environment variables<a class="headerlink" href="#docker-environment-variables" title="Permalink to this headline">¶</a></h3> +<p>You can configure several phpMyAdmin features using environment variables:</p> +<dl class="envvar"> +<dt id="envvar-PMA_ARBITRARY"> +<code class="descname">PMA_ARBITRARY</code><a class="headerlink" href="#envvar-PMA_ARBITRARY" title="Permalink to this definition">¶</a></dt> +<dd><p>Allows you to enter a database server hostname on login form.</p> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last"><span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><code class="xref config config-option docutils literal"><span class="pre">$cfg['AllowArbitraryServer']</span></code></a></p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_HOST"> +<code class="descname">PMA_HOST</code><a class="headerlink" href="#envvar-PMA_HOST" title="Permalink to this definition">¶</a></dt> +<dd><p>Hostname or IP address of the database server to use.</p> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last"><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"><span class="pre">$cfg['Servers'][$i]['host']</span></code></a></p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_HOSTS"> +<code class="descname">PMA_HOSTS</code><a class="headerlink" href="#envvar-PMA_HOSTS" title="Permalink to this definition">¶</a></dt> +<dd><p>Comma-separated hostnames or IP addresses of the database servers to use.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">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"><span class="pre">PMA_HOST</span></code></a> is empty.</p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_VERBOSE"> +<code class="descname">PMA_VERBOSE</code><a class="headerlink" href="#envvar-PMA_VERBOSE" title="Permalink to this definition">¶</a></dt> +<dd><p>Verbose name of the database server.</p> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last"><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"><span class="pre">$cfg['Servers'][$i]['verbose']</span></code></a></p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_VERBOSES"> +<code class="descname">PMA_VERBOSES</code><a class="headerlink" href="#envvar-PMA_VERBOSES" title="Permalink to this definition">¶</a></dt> +<dd><p>Comma-separated verbose name of the database servers.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">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"><span class="pre">PMA_VERBOSE</span></code></a> is empty.</p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_USER"> +<code class="descname">PMA_USER</code><a class="headerlink" href="#envvar-PMA_USER" title="Permalink to this definition">¶</a></dt> +<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> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_PASSWORD"> +<code class="descname">PMA_PASSWORD</code><a class="headerlink" href="#envvar-PMA_PASSWORD" title="Permalink to this definition">¶</a></dt> +<dd><p>Password to use for <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_PORT"> +<code class="descname">PMA_PORT</code><a class="headerlink" href="#envvar-PMA_PORT" title="Permalink to this definition">¶</a></dt> +<dd><p>Port of the database server to use.</p> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_PORTS"> +<code class="descname">PMA_PORTS</code><a class="headerlink" href="#envvar-PMA_PORTS" title="Permalink to this definition">¶</a></dt> +<dd><p>Comma-separated ports of the database server to use.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">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"><span class="pre">PMA_PORT</span></code></a> is empty.</p> +</div> +</dd></dl> + +<dl class="envvar"> +<dt id="envvar-PMA_ABSOLUTE_URI"> +<code class="descname">PMA_ABSOLUTE_URI</code><a class="headerlink" href="#envvar-PMA_ABSOLUTE_URI" title="Permalink to this definition">¶</a></dt> +<dd><p>The fully-qualified path (<code class="docutils literal"><span class="pre">https://pma.example.net/</span></code>) where the reverse +proxy makes phpMyAdmin available.</p> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last"><span class="target" id="index-6"></span><a class="reference internal" href="config.html#cfg_PmaAbsoluteUri"><code class="xref config config-option docutils literal"><span class="pre">$cfg['PmaAbsoluteUri']</span></code></a></p> +</div> +</dd></dl> + +<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-7"></span><a class="reference internal" href="#envvar-PMA_USER"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_USER</span></code></a> and +<span class="target" id="index-8"></span><a class="reference internal" href="#envvar-PMA_PASSWORD"><code class="xref std std-envvar docutils literal"><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> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The credentials you need to log in are stored in the MySQL server, in case +of Docker image, there are various ways to set it (for example +<code class="samp docutils literal"><span class="pre">MYSQL_ROOT_PASSWORD</span></code> when starting the MySQL container). Please check +documentation for <a class="reference external" href="https://hub.docker.com/_/mariadb">MariaDB container</a> +or <a class="reference external" href="https://hub.docker.com/_/mysql">MySQL container</a>.</p> +</div> +</div> +<div class="section" id="customizing-configuration"> +<span id="docker-custom"></span><h3>Customizing configuration<a class="headerlink" href="#customizing-configuration" title="Permalink to this headline">¶</a></h3> +<p>Additionally configuration can be tweaked by <code class="file docutils literal"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code>. If +this file exists, it will be loaded after configuration is generated from above +environment variables, so you can override any configuration variable. This +configuration can be added as a volume when invoking docker using +<cite>-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</cite> parameters.</p> +<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>, +but you can override any of the values.</p> +<p>For example to change the default behavior of CSV export you can use the following +configuration file:</p> +<div class="highlight-php"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="nv">$cfg</span><span class="p">[</span><span class="s1">'Export'</span><span class="p">][</span><span class="s1">'csv_columns'</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span> +</pre></div> +</div> +<p>You can also use it to define server configuration instead of using the +environment variables listed in <a class="reference internal" href="#docker-vars"><span class="std std-ref">Docker environment variables</span></a>:</p> +<div class="highlight-php"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="cm">/* Override Servers array */</span> +<span class="nv">$cfg</span><span class="p">[</span><span class="s1">'Servers'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> + <span class="mi">1</span> <span class="o">=></span> <span class="p">[</span> + <span class="s1">'auth_type'</span> <span class="o">=></span> <span class="s1">'cookie'</span><span class="p">,</span> + <span class="s1">'host'</span> <span class="o">=></span> <span class="s1">'mydb1'</span><span class="p">,</span> + <span class="s1">'port'</span> <span class="o">=></span> <span class="mi">3306</span><span class="p">,</span> + <span class="s1">'verbose'</span> <span class="o">=></span> <span class="s1">'Verbose name 1'</span><span class="p">,</span> + <span class="p">],</span> + <span class="mi">2</span> <span class="o">=></span> <span class="p">[</span> + <span class="s1">'auth_type'</span> <span class="o">=></span> <span class="s1">'cookie'</span><span class="p">,</span> + <span class="s1">'host'</span> <span class="o">=></span> <span class="s1">'mydb2'</span><span class="p">,</span> + <span class="s1">'port'</span> <span class="o">=></span> <span class="mi">3306</span><span class="p">,</span> + <span class="s1">'verbose'</span> <span class="o">=></span> <span class="s1">'Verbose name 2'</span><span class="p">,</span> + <span class="p">],</span> +<span class="p">];</span> +</pre></div> +</div> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last">See <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> for detailed description of configuration options.</p> +</div> +</div> +<div class="section" id="docker-volumes"> +<h3>Docker Volumes<a class="headerlink" href="#docker-volumes" title="Permalink to this headline">¶</a></h3> +<p>You can use the following volumes to customize image behavior:</p> +<p><code class="file docutils literal"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code></p> +<blockquote> +<div>Can be used for additional settings, see the previous chapter for more details.</div></blockquote> +<p><code class="file docutils literal"><span class="pre">/sessions/</span></code></p> +<blockquote> +<div>Directory where PHP sessions are stored. You might want to share this +for example when using <a class="reference internal" href="#auth-signon"><span class="std std-ref">Signon authentication mode</span></a>.</div></blockquote> +<p><code class="file docutils literal"><span class="pre">/www/themes/</span></code></p> +<blockquote> +<div>Directory where phpMyAdmin looks for themes. By default only those shipped +with phpMyAdmin are included, but you can include additional phpMyAdmin +themes (see <a class="reference internal" href="themes.html#themes"><span class="std std-ref">Custom Themes</span></a>) by using Docker volumes.</div></blockquote> +</div> +<div class="section" id="docker-examples"> +<h3>Docker Examples<a class="headerlink" href="#docker-examples" title="Permalink to this headline">¶</a></h3> +<p>To connect phpMyAdmin to a given server use:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d -e <span class="nv">PMA_HOST</span><span class="o">=</span>dbhost -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>To connect phpMyAdmin to more servers use:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d -e <span class="nv">PMA_HOSTS</span><span class="o">=</span>dbhost1,dbhost2,dbhost3 -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>To use arbitrary server option:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -e <span class="nv">PMA_ARBITRARY</span><span class="o">=</span><span class="m">1</span> phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>You can also link the database container using Docker:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>Running with additional configuration:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin +</pre></div> +</div> +<p>Running with additional themes:</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -v /custom/phpmyadmin/theme/:/www/themes/theme/ phpmyadmin/phpmyadmin +</pre></div> +</div> +</div> +<div class="section" id="using-docker-compose"> +<h3>Using docker-compose<a class="headerlink" href="#using-docker-compose" title="Permalink to this headline">¶</a></h3> +<p>Alternatively, you can also use docker-compose with the docker-compose.yml from +<<a class="reference external" href="https://github.com/phpmyadmin/docker">https://github.com/phpmyadmin/docker</a>>. This will run phpMyAdmin with an +arbitrary server - allowing you to specify MySQL/MariaDB server on the login page.</p> +<div class="highlight-sh"><div class="highlight"><pre><span></span>docker-compose up -d +</pre></div> +</div> +</div> +<div class="section" id="customizing-configuration-file-using-docker-compose"> +<h3>Customizing configuration file using docker-compose<a class="headerlink" href="#customizing-configuration-file-using-docker-compose" title="Permalink to this headline">¶</a></h3> +<p>You can use an external file to customize phpMyAdmin configuration and pass it +using the volumes directive:</p> +<div class="highlight-yaml"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span><span class="p p-Indicator">:</span> + <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin/phpmyadmin</span> + <span class="l l-Scalar l-Scalar-Plain">container_name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span> + <span class="l l-Scalar l-Scalar-Plain">environment</span><span class="p p-Indicator">:</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_ARBITRARY=1</span> + <span class="l l-Scalar l-Scalar-Plain">restart</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span> + <span class="l l-Scalar l-Scalar-Plain">ports</span><span class="p p-Indicator">:</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">8080:80</span> + <span class="l l-Scalar l-Scalar-Plain">volumes</span><span class="p p-Indicator">:</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/sessions</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/custom/phpmyadmin/theme/:/www/themes/theme/</span> +</pre></div> +</div> +<div class="admonition seealso"> +<p class="first admonition-title">See also</p> +<p class="last"><a class="reference internal" href="#docker-custom"><span class="std std-ref">Customizing configuration</span></a></p> +</div> +</div> +<div class="section" id="running-behind-haproxy-in-a-subdirectory"> +<h3>Running behind haproxy in a subdirectory<a class="headerlink" href="#running-behind-haproxy-in-a-subdirectory" title="Permalink to this headline">¶</a></h3> +<p>When you want to expose phpMyAdmin running in a Docker container in a +subdirectory, you need to rewrite the request path in the server proxying the +requests.</p> +<p>For example, using haproxy it can be done as:</p> +<div class="highlight-text"><div class="highlight"><pre><span></span>frontend http + bind *:80 + option forwardfor + option http-server-close + + ### NETWORK restriction + acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12 + + # /phpmyadmin + acl phpmyadmin path_dir /phpmyadmin + use_backend phpmyadmin if phpmyadmin LOCALNET + +backend phpmyadmin + mode http + + reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2 + + # phpMyAdmin container IP + server localhost 172.30.21.21:80 +</pre></div> +</div> +<p>When using traefik, something like following should work:</p> +<div class="highlight-text"><div class="highlight"><pre><span></span>defaultEntryPoints = ["http"] +[entryPoints] + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + regex = "(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$" + replacement = "$1/" + +[backends] + [backends.myadmin] + [backends.myadmin.servers.myadmin] + url="http://internal.address.to.pma" + +[frontends] + [frontends.myadmin] + backend = "myadmin" + passHostHeader = true + [frontends.myadmin.routes.default] + rule="PathPrefixStrip:/phpmyadmin/;AddPrefix:/" +</pre></div> +</div> +<p>You then should specify <span class="target" id="index-9"></span><a class="reference internal" href="#envvar-PMA_ABSOLUTE_URI"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_ABSOLUTE_URI</span></code></a> in the docker-compose +configuration:</p> +<div class="highlight-yaml"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">version</span><span class="p p-Indicator">:</span> <span class="s">'2'</span> + +<span class="l l-Scalar l-Scalar-Plain">services</span><span class="p p-Indicator">:</span> + <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span><span class="p p-Indicator">:</span> + <span class="l l-Scalar l-Scalar-Plain">restart</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span> + <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin/phpmyadmin</span> + <span class="l l-Scalar l-Scalar-Plain">container_name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span> + <span class="l l-Scalar l-Scalar-Plain">hostname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span> + <span class="l l-Scalar l-Scalar-Plain">domainname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">example.com</span> + <span class="l l-Scalar l-Scalar-Plain">ports</span><span class="p p-Indicator">:</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">8000:80</span> + <span class="l l-Scalar l-Scalar-Plain">environment</span><span class="p p-Indicator">:</span> + <span class="p p-Indicator">-</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> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_USER=root</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_PASSWORD=</span> + <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="quick-install"> +<span id="id1"></span><h2>Quick Install<a class="headerlink" href="#quick-install" title="Permalink to this headline">¶</a></h2> +<ol class="arabic simple"> +<li>Choose an appropriate distribution kit from the phpmyadmin.net +Downloads page. Some kits contain only the English messages, others +contain all languages. We’ll assume you chose a kit whose name +looks like <code class="docutils literal"><span class="pre">phpMyAdmin-x.x.x</span> <span class="pre">-all-languages.tar.gz</span></code>.</li> +<li>Ensure you have downloaded a genuine archive, see <a class="reference internal" href="#verify"><span class="std std-ref">Verifying phpMyAdmin releases</span></a>.</li> +<li>Untar or unzip the distribution (be sure to unzip the subdirectories): +<code class="docutils literal"><span class="pre">tar</span> <span class="pre">-xzvf</span> <span class="pre">phpMyAdmin_x.x.x-all-languages.tar.gz</span></code> in your +webserver’s document root. If you don’t have direct access to your +document root, put the files in a directory on your local machine, +and, after step 4, transfer the directory on your web server using, +for example, FTP.</li> +<li>Ensure that all the scripts have the appropriate owner (if PHP is +running in safe mode, having some scripts with an owner different from +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 +<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.</li> +<li>Now you must configure your installation. There are two methods that +can be used. Traditionally, users have hand-edited a copy of +<code class="file docutils literal"><span class="pre">config.inc.php</span></code>, but now a wizard-style setup script is provided +for those who prefer a graphical installation. Creating a +<code class="file docutils literal"><span class="pre">config.inc.php</span></code> is still a quick way to get started and needed for +some advanced features.</li> +</ol> +<div class="section" id="manually-creating-the-file"> +<h3>Manually creating the file<a class="headerlink" href="#manually-creating-the-file" title="Permalink to this headline">¶</a></h3> +<p>To manually create the file, simply use your text editor to create the +file <code class="file docutils literal"><span class="pre">config.inc.php</span></code> (you can copy <code class="file docutils literal"><span class="pre">config.sample.inc.php</span></code> to get +a minimal configuration file) in the main (top-level) phpMyAdmin +directory (the one that contains <code class="file docutils literal"><span class="pre">index.php</span></code>). phpMyAdmin first +loads <code class="file docutils literal"><span class="pre">libraries/config.default.php</span></code> and then overrides those values +with anything found in <code class="file docutils literal"><span class="pre">config.inc.php</span></code>. If the default value is +okay for a particular setting, there is no need to include it in +<code class="file docutils literal"><span class="pre">config.inc.php</span></code>. You’ll probably need only a few directives to get going; a +simple configuration may look like this:</p> +<div class="highlight-xml+php"><div class="highlight"><pre><span></span><span class="cp"><?php</span> +<span class="c1">// use here a value of your choice at least 32 chars long</span> +<span class="nv">$cfg</span><span class="p">[</span><span class="s1">'blowfish_secret'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'1{dd0`<Q),5XP_:R9UK%%8\"EEcyH#{o'</span><span class="p">;</span> + +<span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> +<span class="nv">$i</span><span class="o">++</span><span class="p">;</span> +<span class="nv">$cfg</span><span class="p">[</span><span class="s1">'Servers'</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">'auth_type'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'cookie'</span><span class="p">;</span> +<span class="c1">// if you insist on "root" having no password:</span> +<span class="c1">// $cfg['Servers'][$i]['AllowNoPassword'] = true;</span> +</pre></div> +</div> +<p>Or, if you prefer to not be prompted every time you log in:</p> +<div class="highlight-xml+php"><div class="highlight"><pre><span></span><span class="cp"><?php</span> + +<span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> +<span class="nv">$i</span><span class="o">++</span><span class="p">;</span> |
