6 phpMyAdmin does not apply any special security methods to the MySQL
7 database server. It is still the system administrator's job to grant
8 permissions on the MySQL databases properly. phpMyAdmin's :guilabel:`Users`
9 page can be used for this.
14 phpMyAdmin is included in most Linux distributions. It is recommended to use
15 distribution packages when possible - they usually provide integration to your
16 distribution and you will automatically get security updates from your distribution.
23 Most Debian and Ubuntu versions include a phpMyAdmin package, but be aware that
24 the configuration file is maintained in ``/etc/phpmyadmin`` and may differ in
25 some ways from the official phpMyAdmin documentation. Specifically, it does:
27 * Configuration of a web server (works for Apache and lighttpd).
28 * Creating of :ref:`linked-tables` using dbconfig-common.
29 * Securing setup script, see :ref:`debian-setup`.
31 More specific details about installing Debian or Ubuntu packages are available
32 `in our wiki <https://github.com/phpmyadmin/phpmyadmin/wiki/DebianUbuntu>`_.
36 More information can be found in `README.Debian <https://salsa.debian.org/phpmyadmin-team/phpmyadmin/blob/debian/latest/debian/README.Debian>`_
37 (it is installed as :file:`/usr/share/doc/phpmyadmin/README.Debian` with the package).
42 OpenSUSE already comes with phpMyAdmin package, just install packages from
43 the `openSUSE Build Service <https://software.opensuse.org/package/phpMyAdmin>`_.
48 Gentoo ships the phpMyAdmin package, both in a near-stock configuration as well
49 as in a ``webapp-config`` configuration. Use ``emerge dev-db/phpmyadmin`` to
55 Mandriva ships the phpMyAdmin package in their ``contrib`` branch and can be
56 installed via the usual Control Center.
61 Fedora ships the phpMyAdmin package, but be aware that the configuration file
62 is maintained in ``/etc/phpMyAdmin/`` and may differ in some ways from the
63 official phpMyAdmin documentation.
65 Red Hat Enterprise Linux
66 ------------------------
68 Red Hat Enterprise Linux itself and thus derivatives like CentOS don't
69 ship phpMyAdmin, but the Fedora-driven repository
70 `Extra Packages for Enterprise Linux (EPEL) <https://docs.fedoraproject.org/en-US/epel/>`_
72 `enabled <https://fedoraproject.org/wiki/EPEL/FAQ#howtouse>`_.
73 But be aware that the configuration file is maintained in
74 ``/etc/phpMyAdmin/`` and may differ in some ways from the
75 official phpMyAdmin documentation.
80 The easiest way to get phpMyAdmin on Windows is using third party products
81 which include phpMyAdmin together with a database and web server such as
82 `XAMPP <https://www.apachefriends.org/index.html>`_.
84 You can find more of such options at `Wikipedia <https://en.wikipedia.org/wiki/List_of_AMP_packages>`_.
89 In order to install from Git, you'll need a few supporting applications:
91 * `Git <https://git-scm.com/downloads>`_ to download the source, or you can download the most recent source directly from `Github <https://codeload.github.com/phpmyadmin/phpmyadmin/zip/QA_5_2>`_
92 * `Composer <https://getcomposer.org/download/>`__
93 * `Node.js <https://nodejs.org/en/download/>`_ (version 16 or higher)
94 * `Yarn <https://classic.yarnpkg.com/en/docs/install>`_
96 You can clone current phpMyAdmin source from
97 ``https://github.com/phpmyadmin/phpmyadmin.git``:
101 git clone https://github.com/phpmyadmin/phpmyadmin.git
103 Additionally you need to install dependencies using `Composer <https://getcomposer.org>`__:
109 If you do not intend to develop, you can skip the installation of developer tools
114 composer install --no-dev
116 Finally, you'll need to use `Yarn`_ to install some JavaScript dependencies:
120 yarn install --production
124 Installing using Composer
125 +++++++++++++++++++++++++
127 You can install phpMyAdmin using the `Composer tool`_, since 4.7.0 the releases
128 are automatically mirrored to the default `Packagist`_ repository.
132 The content of the Composer repository is automatically generated
133 separately from the releases, so the content doesn't have to be
134 100% same as when you download the tarball. There should be no
135 functional differences though.
137 To install phpMyAdmin simply run:
141 composer create-project phpmyadmin/phpmyadmin
143 Alternatively you can use our own composer repository, which contains
144 the release tarballs and is available at
145 <https://www.phpmyadmin.net/packages.json>:
149 composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev
153 Installing using Docker
154 +++++++++++++++++++++++
156 phpMyAdmin comes with a `Docker official image`_, which you can easily deploy. You can
161 docker pull phpmyadmin
163 The phpMyAdmin server will listen on port 80. It supports several ways of
164 configuring the link to the database server, either by Docker's link feature
165 by linking your database container to ``db`` for phpMyAdmin (by specifying
166 ``--link your_db_host:db``) or by environment variables (in this case it's up
167 to you to set up networking in Docker to allow the phpMyAdmin container to access
168 the database container over the network).
172 Docker environment variables
173 ----------------------------
175 You can configure several phpMyAdmin features using environment variables:
177 .. envvar:: PMA_ARBITRARY
179 Allows you to enter a database server hostname on login form.
181 .. seealso:: :config:option:`$cfg['AllowArbitraryServer']`
185 Hostname or IP address of the database server to use.
187 .. seealso:: :config:option:`$cfg['Servers'][$i]['host']`
189 .. envvar:: PMA_HOSTS
191 Comma-separated hostnames or IP addresses of the database servers to use.
193 .. note:: Used only if :envvar:`PMA_HOST` is empty.
195 .. envvar:: PMA_VERBOSE
197 Verbose name of the database server.
199 .. seealso:: :config:option:`$cfg['Servers'][$i]['verbose']`
201 .. envvar:: PMA_VERBOSES
203 Comma-separated verbose name of the database servers.
205 .. note:: Used only if :envvar:`PMA_VERBOSE` is empty.
209 User name to use for :ref:`auth_config`.
211 .. envvar:: PMA_PASSWORD
213 Password to use for :ref:`auth_config`.
217 Port of the database server to use.
219 .. envvar:: PMA_PORTS
221 Comma-separated ports of the database server to use.
223 .. note:: Used only if :envvar:`PMA_PORT` is empty.
225 .. envvar:: PMA_SOCKET
227 Socket file for the database connection.
229 .. envvar:: PMA_SOCKETS
231 Comma-separated list of socket files for the database connections.
233 .. note:: Used only if :envvar:`PMA_SOCKET` is empty.
235 .. envvar:: PMA_ABSOLUTE_URI
237 The fully-qualified path (``https://pma.example.net/``) where the reverse
238 proxy makes phpMyAdmin available.
240 .. seealso:: :config:option:`$cfg['PmaAbsoluteUri']`
242 .. envvar:: PMA_QUERYHISTORYDB
244 When set to `true`, enables storing SQL history to :config:option:`$cfg['Servers'][$i]['pmadb']`.
245 When `false`, history is stored in the browser and is cleared when logging out.
247 .. seealso:: :config:option:`$cfg['Servers'][$i]['history']`
248 .. seealso:: :config:option:`$cfg['QueryHistoryDB']`
250 .. envvar:: PMA_QUERYHISTORYMAX
252 When set to an integer, controls the number of history items.
254 .. seealso:: :config:option:`$cfg['QueryHistoryMax']`
256 .. envvar:: PMA_CONTROLHOST
258 When set, this points to an alternate database host used for storing the ":ref:`linked-tables`" database.
260 .. seealso:: :config:option:`$cfg['Servers'][$i]['controlhost']`
262 .. envvar:: PMA_CONTROLUSER
264 Defines the username for phpMyAdmin to use for the ":ref:`linked-tables`" database.
266 .. seealso:: :config:option:`$cfg['Servers'][$i]['controluser']`
268 .. envvar:: PMA_CONTROLPASS
270 Defines the password for phpMyAdmin to use for the ":ref:`linked-tables`" database.
272 .. seealso:: :config:option:`$cfg['Servers'][$i]['controlpass']`
274 .. envvar:: PMA_CONTROLPORT
276 When set, will override the default port (`3306`) for connecting to the control host.
278 .. seealso:: :config:option:`$cfg['Servers'][$i]['controlport']`
280 .. envvar:: PMA_PMADB
282 When set, define the name of the database to be used for the ":ref:`linked-tables`" database.
283 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 :ref:`zeroconf` feature.
285 .. note:: Suggested values: `phpmyadmin` or `pmadb`
287 .. seealso:: :config:option:`$cfg['Servers'][$i]['pmadb']`
289 .. envvar:: HIDE_PHP_VERSION
291 If defined, this option will hide the PHP version (`expose_php = Off`).
292 Set to any value (such as `HIDE_PHP_VERSION=true`).
294 .. envvar:: UPLOAD_LIMIT
296 If set, this option will override the default value for apache and php-fpm (this will change ``upload_max_filesize`` and ``post_max_size`` values).
298 .. note:: Format as `[0-9+](K,M,G)` default value is `2048K`
300 .. envvar:: MEMORY_LIMIT
302 If set, this option will override the phpMyAdmin memory limit :config:option:`$cfg['MemoryLimit']` and PHP's `memory_limit`.
304 .. note:: Format as `[0-9+](K,M,G)` where `K` is for Kilobytes, `M` for Megabytes, `G` for Gigabytes and `1K` = 1024 bytes. Default value is `512M`.
306 .. envvar:: MAX_EXECUTION_TIME
308 If set, this option will override the maximum execution time in seconds for phpMyAdmin :config:option:`$cfg['ExecTimeLimit']` and PHP's `max_execution_time`.
310 .. note:: Format as `[0-9+]`. Default value is `600`.
312 .. envvar:: PMA_CONFIG_BASE64
314 If set, this option will override the default `config.inc.php` with the base64 decoded contents of the variable.
316 .. envvar:: PMA_USER_CONFIG_BASE64
318 If set, this option will override the default `config.user.inc.php` with the base64 decoded contents of the variable.
320 .. envvar:: PMA_UPLOADDIR
322 If set, this option will set the path where files can be saved to be available to import (:config:option:`$cfg['UploadDir']`)
324 .. envvar:: PMA_SAVEDIR
326 If set, this option will set the path where exported files can be saved (:config:option:`$cfg['SaveDir']`)
328 .. envvar:: APACHE_PORT
330 If set, this option will change the default Apache port from `80` in case you want it to run on a different port like an unprivileged port. Set to any port value (such as `APACHE_PORT=8090`).
332 .. envvar:: PMA_SSL_DIR
334 Define the path used for SSL files generated from environment variables, default value is `/etc/phpmyadmin/ssl`.
338 When set to `1`, defines SSL usage for the MySQL connection.
340 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl']`
344 Comma-separated list of `0` and `1` defining SSL usage for the corresponding MySQL connections.
346 .. envvar:: PMA_SSL_VERIFY
348 When set to `1`, enables SSL certificate verification for the MySQL connection.
350 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
352 .. envvar:: PMA_SSL_VERIFIES
354 Comma-separated list of `0` and `1` to enable or disable SSL certificate verification for multiple MySQL connections.
356 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
358 .. envvar:: PMA_SSL_CA
360 In the context of mutual TLS security, allows setting your CA file as a string inside the default `config.inc.php`.
362 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
364 .. envvar:: PMA_SSL_CAS
366 In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of strings inside the default `config.inc.php`.
368 .. envvar:: PMA_SSL_CA_BASE64
370 In the context of mutual TLS security, allows setting your CA file as a base64 string inside the default `config.inc.php`.
372 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
374 .. envvar:: PMA_SSL_CAS_BASE64
376 In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of base64 strings inside the default `config.inc.php`.
378 .. envvar:: PMA_SSL_CERT
380 In the context of mutual TLS security, allows setting your CERT file as a string inside the default `config.inc.php`.
382 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
384 .. envvar:: PMA_SSL_CERTS
386 In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of strings inside the default `config.inc.php`.
388 .. envvar:: PMA_SSL_CERT_BASE64
390 In the context of mutual TLS security, allows setting your CERT file as a base64 string inside the default `config.inc.php`.
392 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
394 .. envvar:: PMA_SSL_CERTS_BASE64
396 In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of base64 strings inside the default `config.inc.php`.
398 .. envvar:: PMA_SSL_KEY
400 In the context of mutual TLS security, allows setting your KEY file as a string inside the default `config.inc.php`.
402 .. envvar:: PMA_SSL_KEYS
404 In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of strings inside the default `config.inc.php`.
406 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
408 .. envvar:: PMA_SSL_KEY_BASE64
410 In the context of mutual TLS security, allows setting your KEY file as a base64 string inside the default `config.inc.php`.
412 .. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
414 .. envvar:: PMA_SSL_KEYS_BASE64
416 In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of base64 strings inside the default `config.inc.php`.
420 If defined, this option will change the default PHP `date.timezone` from `UTC`.
422 .. seealso:: :config:option:`$cfg['Servers'][$i]['SessionTimeZone']`
424 By default, :ref:`cookie` is used, but if :envvar:`PMA_USER` and
425 :envvar:`PMA_PASSWORD` are set, it is switched to :ref:`auth_config`.
429 The credentials you need to log in are stored in the MySQL server, in case
430 of Docker image, there are various ways to set it (for example
431 :samp:`MYSQL_ROOT_PASSWORD` when starting the MySQL container). Please check
432 documentation for `MariaDB container <https://hub.docker.com/_/mariadb>`_
433 or `MySQL container <https://hub.docker.com/_/mysql>`_.
437 Customizing configuration
438 -------------------------
440 Additionally configuration can be tweaked by :file:`/etc/phpmyadmin/config.user.inc.php`. If
441 this file exists, it will be loaded after configuration is generated from above
442 environment variables, so you can override any configuration variable. This
443 configuration can be added as a volume when invoking docker using
444 `-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php` parameters.
446 Note that the supplied configuration file is applied after :ref:`docker-vars`,
447 but you can override any of the values.
449 For example to change the default behavior of CSV export you can use the following
455 $cfg['Export']['csv_columns'] = true;
457 You can also use it to define server configuration instead of using the
458 environment variables listed in :ref:`docker-vars`:
463 /* Override Servers array */
466 'auth_type' => 'cookie',
469 'verbose' => 'Verbose name 1',
472 'auth_type' => 'cookie',
475 'verbose' => 'Verbose name 2',
481 See :ref:`config` for detailed description of configuration options.
486 You can use the following volumes to customize image behavior:
488 :file:`/etc/phpmyadmin/config.user.inc.php`
490 Can be used for additional settings, see the previous chapter for more details.
494 Directory where PHP sessions are stored. You might want to share this
495 for example when using :ref:`auth_signon`.
499 Directory where phpMyAdmin looks for themes. By default only those shipped
500 with phpMyAdmin are included, but you can include additional phpMyAdmin
501 themes (see :ref:`themes`) by using Docker volumes.
506 To connect phpMyAdmin to a given server use:
510 docker run --name phpmyadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin:latest
512 To connect phpMyAdmin to more servers use:
516 docker run --name phpmyadmin -d -e PMA_HOSTS=dbhost1,dbhost2,dbhost3 -p 8080:80 phpmyadmin:latest
518 To use arbitrary server option:
522 docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin:latest
524 You can also link the database container using Docker:
528 docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin:latest
530 Running with additional configuration:
534 docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin:latest
536 Running with additional themes:
540 docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/custom/phpmyadmin/themeName/:/var/www/html/themes/themeName/ phpmyadmin:latest
545 Alternatively, you can also use docker-compose with the docker-compose.yml from
546 <https://github.com/phpmyadmin/docker>. This will run phpMyAdmin with an
547 arbitrary server - allowing you to specify MySQL/MariaDB server on the login page.
553 Customizing configuration file using docker-compose
554 ---------------------------------------------------
556 You can use an external file to customize phpMyAdmin configuration and pass it
557 using the volumes directive:
562 image: phpmyadmin:latest
563 container_name: phpmyadmin
571 - ~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
572 - /custom/phpmyadmin/theme/:/www/themes/theme/
574 .. seealso:: :ref:`docker-custom`
576 Running behind haproxy in a subdirectory
577 ----------------------------------------
579 When you want to expose phpMyAdmin running in a Docker container in a
580 subdirectory, you need to rewrite the request path in the server proxying the
583 For example, using haproxy it can be done as:
590 option http-server-close
592 ### NETWORK restriction
593 acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
596 acl phpmyadmin path_dir /phpmyadmin
597 use_backend phpmyadmin if phpmyadmin LOCALNET
602 reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2
604 # phpMyAdmin container IP
605 server localhost 172.30.21.21:80
607 When using traefik, something like following should work:
611 defaultEntryPoints = ["http"]
615 [entryPoints.http.redirect]
616 regex = "(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$"
621 [backends.myadmin.servers.myadmin]
622 url="http://internal.address.to.pma"
627 passHostHeader = true
628 [frontends.myadmin.routes.default]
629 rule="PathPrefixStrip:/phpmyadmin/;AddPrefix:/"
631 You then should specify :envvar:`PMA_ABSOLUTE_URI` in the docker-compose
641 image: phpmyadmin:latest
642 container_name: phpmyadmin
644 domainname: example.com
648 - PMA_HOSTS=172.26.36.7,172.26.36.8,172.26.36.9,172.26.36.10
649 - PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2
652 - PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/
657 One of our users has created a helpful guide for installing phpMyAdmin on the
658 `IBM Cloud platform <https://github.com/KissConsult/phpmyadmin_tutorial#readme>`_.
665 #. Choose an appropriate distribution kit from the phpmyadmin.net
666 Downloads page. Some kits contain only the English messages, others
667 contain all languages. We'll assume you chose a kit whose name
668 looks like ``phpMyAdmin-x.x.x-all-languages.tar.gz``.
669 #. Ensure you have downloaded a genuine archive, see :ref:`verify`.
670 #. Untar or unzip the distribution (be sure to unzip the subdirectories):
671 ``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your
672 webserver's document root. If you don't have direct access to your
673 document root, put the files in a directory on your local machine,
674 and, after step 4, transfer the directory on your web server using,
676 #. Ensure that all the scripts have the appropriate owner (if PHP is
677 running in safe mode, having some scripts with an owner different from
678 the owner of other scripts will be a problem). See :ref:`faq4_2` and
679 :ref:`faq1_26` for suggestions.
680 #. Now you must configure your installation. There are two methods that
681 can be used. Traditionally, users have hand-edited a copy of
682 :file:`config.inc.php`, but now a wizard-style setup script is provided
683 for those who prefer a graphical installation. Creating a
684 :file:`config.inc.php` is still a quick way to get started and needed for
685 some advanced features.
687 Manually creating the file
688 --------------------------
690 To manually create the file, simply use your text editor to create the
691 file :file:`config.inc.php` (you can copy :file:`config.sample.inc.php` to get
692 a minimal configuration file) in the main (top-level) phpMyAdmin
693 directory (the one that contains :file:`index.php`). phpMyAdmin first
694 loads the default configuration values and then overrides those values
695 with anything found in :file:`config.inc.php`. If the default value is
696 okay for a particular setting, there is no need to include it in
697 :file:`config.inc.php`. You'll probably need only a few directives to get going; a
698 simple configuration may look like this:
700 .. code-block:: xml+php
703 // The string is a hexadecimal representation of a 32-bytes long string of random bytes.
704 $cfg['blowfish_secret'] = sodium_hex2bin('f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851');
708 $cfg['Servers'][$i]['auth_type'] = 'cookie';
709 // if you insist on "root" having no password:
710 // $cfg['Servers'][$i]['AllowNoPassword'] = true;
712 Or, if you prefer to not be prompted every time you log in:
714 .. code-block:: xml+php
720 $cfg['Servers'][$i]['user'] = 'root';
721 $cfg['Servers'][$i]['password'] = 'changeme'; // use here your password
722 $cfg['Servers'][$i]['auth_type'] = 'config';
726 Storing passwords in the configuration is insecure as anybody can then
727 manipulate your database.
729 For a full explanation of possible configuration values, see the
730 :ref:`config` of this document.
732 .. index:: Setup script
736 Using the Setup script
737 ----------------------
739 Instead of manually editing :file:`config.inc.php`, you can use phpMyAdmin's
740 setup feature. The file can be generated using the setup and you can download it
741 for upload to the server.
743 Next, open your browser and visit the location where you installed phpMyAdmin,
744 with the ``/setup`` suffix. The changes are not saved to the server, you need to
745 use the :guilabel:`Download` button to save them to your computer and then upload
748 Now the file is ready to be used. You can choose to review or edit the
749 file with your favorite editor, if you prefer to set some advanced
750 options that the setup script does not provide.
752 #. If you are using the ``auth_type`` "config", it is suggested that you
753 protect the phpMyAdmin installation directory because using config
754 does not require a user to enter a password to access the phpMyAdmin
755 installation. Use of an alternate authentication method is
756 recommended, for example with HTTP–AUTH in a :term:`.htaccess` file or switch to using
757 ``auth_type`` cookie or http. See the :ref:`faqmultiuser`
758 for additional information, especially :ref:`faq4_4`.
759 #. Open the main phpMyAdmin directory in your browser.
760 phpMyAdmin should now display a welcome screen and your databases, or
761 a login dialog if using :term:`HTTP` or
762 cookie authentication mode.
766 Setup script on Debian, Ubuntu and derivatives
767 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
769 Debian and Ubuntu have changed the way in which the setup script is enabled and disabled, in a way
770 that single command has to be executed for either of these.
772 To allow editing configuration invoke:
776 /usr/sbin/pma-configure
778 To block editing configuration invoke:
784 Setup script on openSUSE
785 ~~~~~~~~~~~~~~~~~~~~~~~~
787 Some openSUSE releases do not include setup script in the package. In case you
788 want to generate configuration on these you can either download original
789 package from <https://www.phpmyadmin.net/> or use setup script on our demo
790 server: <https://demo.phpmyadmin.net/master/setup/>.
794 Verifying phpMyAdmin releases
795 +++++++++++++++++++++++++++++
797 Since July 2015 all phpMyAdmin releases are cryptographically signed by the
798 releasing developer, who through January 2016 was Marc Delisle. His key id is
799 0xFEFC65D181AF644A, his PGP fingerprint is:
801 .. code-block:: console
803 436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A
805 and you can get more identification information from <https://keybase.io/lem9>.
807 Beginning in January 2016, the release manager is Isaac Bennetch. His key id is
808 0xCE752F178259BD92, and his PGP fingerprint is:
810 .. code-block:: console
812 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92
814 and you can get more identification information from <https://keybase.io/ibennetch>.
816 Some additional downloads (for example themes) might be signed by Michal Čihař. His key id is
817 0x9C27B31342B7511D, and his PGP fingerprint is:
819 .. code-block:: console
821 63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D
823 and you can get more identification information from <https://keybase.io/nijel>.
825 You should verify that the signature matches the archive you have downloaded.
826 This way you can be sure that you are using the same code that was released.
827 You should also verify the date of the signature to make sure that you
828 downloaded the latest version.
830 Each archive is accompanied by ``.asc`` files which contain the PGP signature
831 for it. Once you have both of them in the same folder, you can verify the signature:
833 .. code-block:: console
835 $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
836 gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
837 gpg: Can't check signature: public key not found
839 As you can see gpg complains that it does not know the public key. At this
840 point, you should do one of the following steps:
842 * Download the keyring from `our download server <https://files.phpmyadmin.net/phpmyadmin.keyring>`_, then import it with:
844 .. code-block:: console
846 $ gpg --import phpmyadmin.keyring
848 * Download and import the key from one of the key servers:
850 .. code-block:: console
852 $ gpg --keyserver hkp://pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92
853 gpg: requesting key 8259BD92 from hkp server pgp.mit.edu
854 gpg: key 8259BD92: public key "Isaac Bennetch <bennetch@gmail.com>" imported
855 gpg: no ultimately trusted keys found
856 gpg: Total number processed: 1
857 gpg: imported: 1 (RSA: 1)
859 This will improve the situation a bit - at this point, you can verify that the
860 signature from the given key is correct but you still can not trust the name used
863 .. code-block:: console
865 $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
866 gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
867 gpg: Good signature from "Isaac Bennetch <bennetch@gmail.com>"
868 gpg: aka "Isaac Bennetch <isaac@bennetch.org>"
869 gpg: WARNING: This key is not certified with a trusted signature!
870 gpg: There is no indication that the signature belongs to the owner.
871 Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92
873 The problem here is that anybody could issue the key with this name. You need to
874 ensure that the key is actually owned by the mentioned person. The GNU Privacy
875 Handbook covers this topic in the chapter `Validating other keys on your public
876 keyring`_. The most reliable method is to meet the developer in person and
877 exchange key fingerprints, however, you can also rely on the web of trust. This way
878 you can trust the key transitively though signatures of others, who have met
879 the developer in person.
881 Once the key is trusted, the warning will not occur:
883 .. code-block:: console
885 $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
886 gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
887 gpg: Good signature from "Isaac Bennetch <bennetch@gmail.com>" [full]
889 Should the signature be invalid (the archive has been changed), you would get a
890 clear error regardless of the fact that the key is trusted or not:
892 .. code-block:: console
894 $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
895 gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
896 gpg: BAD signature from "Isaac Bennetch <bennetch@gmail.com>" [unknown]
898 .. _Validating other keys on your public keyring: https://www.gnupg.org/gph/en/manual.html#AEN335
901 single: Configuration storage
902 single: phpMyAdmin configuration storage
907 phpMyAdmin configuration storage
908 ++++++++++++++++++++++++++++++++
910 .. versionchanged:: 3.4.0
912 Prior to phpMyAdmin 3.4.0 this was called Linked Tables Infrastructure, but
913 the name was changed due to the extended scope of the storage.
915 For a whole set of additional features (:ref:`bookmarks`, comments, :term:`SQL`-history,
916 tracking mechanism, :term:`PDF`-generation, :ref:`transformations`, :ref:`relations`
917 etc.) you need to create a set of special tables. Those tables can be located
918 in your own database, or in a central database for a multi-user installation
919 (this database would then be accessed by the controluser, so no other user
920 should have rights to it).
927 In many cases, this database structure can be automatically created and
928 configured. This is called “Zero Configuration” mode and can be particularly
929 useful in shared hosting situations. “ZeroConf” mode is on by default, to
930 disable set :config:option:`$cfg['ZeroConf']` to false.
932 The following three scenarios are covered by the Zero Configuration mode:
934 * When entering a database where the configuration storage tables are not
935 present, phpMyAdmin offers to create them from the Operations tab.
936 * When entering a database where the tables do already exist, the software
937 automatically detects this and begins using them. This is the most common
938 situation; after the tables are initially created automatically they are
939 continually used without disturbing the user; this is also most useful on
940 shared hosting where the user is not able to edit :file:`config.inc.php` and
941 usually the user only has access to one database.
942 * When having access to multiple databases, if the user first enters the
943 database containing the configuration storage tables then switches to
945 phpMyAdmin continues to use the tables from the first database; the user is
946 not prompted to create more tables in the new database.
951 Please look at your ``./resources/sql/`` directory, where you should find a
952 file called *create\_tables.sql*. (If you are using a Windows server,
953 pay special attention to :ref:`faq1_23`).
955 If you already had this infrastructure and:
957 * upgraded to MySQL 4.1.2 or newer, please use
958 :file:`resources/sql/upgrade_tables_mysql_4_1_2+.sql`.
959 * upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (<= 4.2.x),
960 please use :file:`resources/sql/upgrade_column_info_4_3_0+.sql`.
961 * upgraded to phpMyAdmin 4.7.0 or newer from 4.3.0 or newer,
962 please use :file:`resources/sql/upgrade_tables_4_7_0+.sql`.
964 and then create new tables by importing :file:`resources/sql/create_tables.sql`.
966 You can use your phpMyAdmin to create the tables for you. Please be
967 aware that you may need special (administrator) privileges to create
968 the database and tables, and that the script may need some tuning,
969 depending on the database name.
971 After having imported the :file:`resources/sql/create_tables.sql` file, you
972 should specify the table names in your :file:`config.inc.php` file. The
973 directives used for that can be found in the :ref:`config`.
975 You will also need to have a controluser
976 (:config:option:`$cfg['Servers'][$i]['controluser']` and
977 :config:option:`$cfg['Servers'][$i]['controlpass']` settings)
978 with the proper rights to those tables. For example you can create it
979 using following statement:
981 And for any MariaDB version:
983 .. code-block:: mysql
985 CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING 'pmapass';
986 GRANT SELECT, INSERT, UPDATE, DELETE ON `<pma_db>`.* TO 'pma'@'localhost';
988 For MySQL 8.0 and newer:
990 .. code-block:: mysql
992 CREATE USER 'pma'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'pmapass';
993 GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
995 For MySQL older than 8.0:
997 .. code-block:: mysql
999 CREATE USER 'pma'@'localhost' IDENTIFIED WITH mysql_native_password AS 'pmapass';
1000 GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
1002 Note that MySQL installations with PHP older than 7.4 and MySQL newer than 8.0 may require
1003 using the mysql_native_password authentication as a workaround, see
1004 :ref:`faq1_45` for details.
1008 Upgrading from an older version
1009 +++++++++++++++++++++++++++++++
1013 **Never** extract the new version over an existing installation of
1014 phpMyAdmin, always first remove the old files keeping just the
1017 This way, you will not leave any old or outdated files in the directory,
1018 which can have severe security implications or can cause various breakages.
1020 Simply copy :file:`config.inc.php` from your previous installation into
1021 the newly unpacked one. Configuration files from old versions may
1022 require some tweaking as some options have been changed or removed.
1023 For compatibility with PHP 5.3 and later, remove a
1024 ``set_magic_quotes_runtime(0);`` statement that you might find near
1025 the end of your configuration file.
1027 The complete upgrade can be performed in a few simple steps:
1029 1. Download the latest phpMyAdmin version from <https://www.phpmyadmin.net/downloads/>.
1030 2. Rename existing phpMyAdmin folder (for example to ``phpmyadmin-old``).
1031 3. Unpack freshly downloaded phpMyAdmin to the desired location (for example ``phpmyadmin``).
1032 4. Copy :file:`config.inc.php`` from old location (``phpmyadmin-old``) to the new one (``phpmyadmin``).
1033 5. Test that everything works properly.
1034 6. Remove backup of a previous version (``phpmyadmin-old``).
1036 If you have upgraded your MySQL server from a version previous to 4.1.2 to
1037 version 5.x or newer and if you use the phpMyAdmin configuration storage, you
1038 should run the :term:`SQL` script found in
1039 :file:`resources/sql/upgrade_tables_mysql_4_1_2+.sql`.
1041 If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or
1042 newer (<= 4.2.x) and if you use the phpMyAdmin configuration storage, you
1043 should run the :term:`SQL` script found in
1044 :file:`resources/sql/upgrade_column_info_4_3_0+.sql`.
1046 Do not forget to clear the browser cache and to empty the old session by
1047 logging out and logging in again.
1049 .. index:: Authentication mode
1051 .. _authentication_modes:
1053 Using authentication modes
1054 ++++++++++++++++++++++++++
1056 :term:`HTTP` and cookie authentication modes are recommended in a **multi-user
1057 environment** where you want to give users access to their own database and
1058 don't want them to play around with others. Nevertheless, be aware that MS
1059 Internet Explorer seems to be really buggy about cookies, at least till version
1060 6. Even in a **single-user environment**, you might prefer to use :term:`HTTP`
1061 or cookie mode so that your user/password pair are not in clear in the
1064 :term:`HTTP` and cookie authentication
1065 modes are more secure: the MySQL login information does not need to be
1066 set in the phpMyAdmin configuration file (except possibly for the
1067 :config:option:`$cfg['Servers'][$i]['controluser']`).
1068 However, keep in mind that the password travels in plain text unless
1069 you are using the HTTPS protocol. In cookie mode, the password is
1070 stored, encrypted with the AES algorithm, in a temporary cookie.
1072 Then each of the *true* users should be granted a set of privileges
1073 on a set of particular databases. Normally you shouldn't give global
1074 privileges to an ordinary user unless you understand the impact of those
1075 privileges (for example, you are creating a superuser).
1076 For example, to grant the user *real_user* with all privileges on
1077 the database *user_base*:
1079 .. code-block:: mysql
1081 GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
1083 What the user may now do is controlled entirely by the MySQL user management
1084 system. With HTTP or cookie authentication mode, you don't need to fill the
1085 user/password fields inside the :config:option:`$cfg['Servers']`.
1095 .. index:: pair: HTTP; Authentication mode
1099 HTTP authentication mode
1100 ------------------------
1102 * Uses :term:`HTTP` Basic authentication
1103 method and allows you to log in as any valid MySQL user.
1104 * Is supported with most PHP configurations. For :term:`IIS` (:term:`ISAPI`)
1105 support using :term:`CGI` PHP see :ref:`faq1_32`, for using with Apache
1106 :term:`CGI` see :ref:`faq1_35`.
1107 * When PHP is running under Apache's :term:`mod_proxy_fcgi` (e.g. with PHP-FPM),
1108 ``Authorization`` headers are not passed to the underlying FCGI application,
1109 such that your credentials will not reach the application. In this case, you can
1110 add the following configuration directive:
1112 .. code-block:: apache
1114 SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
1116 * See also :ref:`faq4_4` about not using the :term:`.htaccess` mechanism along with
1117 ':term:`HTTP`' authentication mode.
1121 There is no way to do proper logout in HTTP authentication, most browsers
1122 will remember credentials until there is no different successful
1123 authentication. Because of this, this method has a limitation that you can not
1124 login with the same user after logout.
1126 .. index:: pair: Cookie; Authentication mode
1130 Cookie authentication mode
1131 --------------------------
1133 * Username and password are stored in cookies during the session and password
1134 is deleted when it ends.
1135 * With this mode, the user can truly log out of phpMyAdmin and log
1136 back in with the same username (this is not possible with :ref:`auth_http`).
1137 * If you want to allow users to enter any hostname to connect (rather than only
1138 servers that are configured in :file:`config.inc.php`),
1139 see the :config:option:`$cfg['AllowArbitraryServer']` directive.
1140 * As mentioned in the :ref:`require` section, having the ``openssl`` extension
1141 will speed up access considerably, but is not required.
1143 .. index:: pair: Signon; Authentication mode
1147 Signon authentication mode
1148 --------------------------
1150 * This mode is a convenient way of using credentials from another
1151 application to authenticate to phpMyAdmin to implement a single signon
1153 * The other application has to store login information into session
1154 data (see :config:option:`$cfg['Servers'][$i]['SignonSession']` and
1155 :config:option:`$cfg['Servers'][$i]['SignonCookieParams']`) or you
1156 need to implement script to return the credentials (see
1157 :config:option:`$cfg['Servers'][$i]['SignonScript']`).
1158 * When no credentials are available, the user is being redirected to
1159 :config:option:`$cfg['Servers'][$i]['SignonURL']`, where you should handle
1162 The very basic example of saving credentials in a session is available as
1163 :file:`examples/signon.php`:
1165 .. literalinclude:: ../examples/signon.php
1168 Alternatively, you can also use this way to integrate with OpenID as shown
1169 in :file:`examples/openid.php`:
1171 .. literalinclude:: ../examples/openid.php
1174 If you intend to pass the credentials using some other means than, you have to
1175 implement wrapper in PHP to get that data and set it to
1176 :config:option:`$cfg['Servers'][$i]['SignonScript']`. There is a very minimal example
1177 in :file:`examples/signon-script.php`:
1179 .. literalinclude:: ../examples/signon-script.php
1183 :config:option:`$cfg['Servers'][$i]['auth_type']`,
1184 :config:option:`$cfg['Servers'][$i]['SignonSession']`,
1185 :config:option:`$cfg['Servers'][$i]['SignonCookieParams']`,
1186 :config:option:`$cfg['Servers'][$i]['SignonScript']`,
1187 :config:option:`$cfg['Servers'][$i]['SignonURL']`,
1188 :ref:`example-signon`
1190 .. index:: pair: Config; Authentication mode
1194 Config authentication mode
1195 --------------------------
1197 * This mode is sometimes the less secure one because it requires you to fill the
1198 :config:option:`$cfg['Servers'][$i]['user']` and
1199 :config:option:`$cfg['Servers'][$i]['password']`
1200 fields (and as a result, anyone who can read your :file:`config.inc.php`
1201 can discover your username and password).
1202 * In the :ref:`faqmultiuser` section, there is an entry explaining how
1203 to protect your configuration file.
1204 * For additional security in this mode, you may wish to consider the
1205 Host authentication :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']`
1206 and :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` configuration directives.
1207 * Unlike cookie and http, does not require a user to log in when first
1208 loading the phpMyAdmin site. This is by design but could allow any
1209 user to access your installation. Use of some restriction method is
1210 suggested, perhaps a :term:`.htaccess` file with the HTTP-AUTH directive or disallowing
1211 incoming HTTP requests at one’s router or firewall will suffice (both
1212 of which are beyond the scope of this manual but easily searchable
1217 Securing your phpMyAdmin installation
1218 +++++++++++++++++++++++++++++++++++++
1220 The phpMyAdmin team tries hard to make the application secure, however there
1221 are always ways to make your installation more secure:
1223 * Follow our `Security announcements <https://www.phpmyadmin.net/security/>`_ and upgrade
1224 phpMyAdmin whenever new vulnerability is published.
1225 * Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that
1226 you're protected from protocol downgrade attacks.
1227 * Ensure your PHP setup follows recommendations for production sites, for example
1228 `display_errors <https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors>`_
1230 * Remove the ``tests`` directory from phpMyAdmin, unless you are developing and need a test suite.
1231 * Remove the ``setup`` directory from phpMyAdmin, you will probably not
1232 use it after the initial setup.
1233 * Properly choose an authentication method - :ref:`cookie`
1234 is probably the best choice for shared hosting.
1235 * Deny access to auxiliary files in :file:`./libraries/` or
1236 :file:`./templates/` subfolders in your webserver configuration.
1237 Such configuration prevents from possible path exposure and cross side
1238 scripting vulnerabilities that might happen to be found in that code. For the
1239 Apache webserver, this is often accomplished with a :term:`.htaccess` file in
1241 * Deny access to temporary files, see :config:option:`$cfg['TempDir']` (if that
1242 is placed inside your web root, see also :ref:`web-dirs`.
1243 * It is generally a good idea to protect a public phpMyAdmin installation
1244 against access by robots as they usually can not do anything good there. You
1245 can do this using ``robots.txt`` file in the root of your webserver or limit
1246 access by web server configuration, see :ref:`faq1_42`.
1247 * In case you don't want all MySQL users to be able to access
1248 phpMyAdmin, you can use :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` to limit them
1249 or :config:option:`$cfg['Servers'][$i]['AllowRoot']` to deny root user access.
1250 * Enable :ref:`2fa` for your account.
1251 * Consider hiding phpMyAdmin behind an authentication proxy, so that
1252 users need to authenticate prior to providing MySQL credentials
1253 to phpMyAdmin. You can achieve this by configuring your web server to request
1254 HTTP authentication. For example in Apache this can be done with:
1256 .. code-block:: apache
1259 AuthName "Restricted Access"
1260 AuthUserFile /usr/share/phpmyadmin/passwd
1263 Once you have changed the configuration, you need to create a list of users which
1264 can authenticate. This can be done using the :program:`htpasswd` utility:
1268 htpasswd -c /usr/share/phpmyadmin/passwd username
1270 * If you are afraid of automated attacks, enabling Captcha by
1271 :config:option:`$cfg['CaptchaLoginPublicKey']` and
1272 :config:option:`$cfg['CaptchaLoginPrivateKey']` might be an option.
1273 * Failed login attempts are logged to syslog (if available, see
1274 :config:option:`$cfg['AuthLog']`). This can allow using a tool such as
1275 fail2ban to block brute-force attempts. Note that the log file used by syslog
1276 is not the same as the Apache error or access log files.
1277 * In case you're running phpMyAdmin together with other PHP applications, it is
1278 generally advised to use separate session storage for phpMyAdmin to avoid
1279 possible session-based attacks against it. You can use
1280 :config:option:`$cfg['SessionSavePath']` to achieve this.
1284 Using SSL for connection to database server
1285 +++++++++++++++++++++++++++++++++++++++++++
1287 It is recommended to use SSL when connecting to remote database server. There
1288 are several configuration options involved in the SSL setup:
1290 :config:option:`$cfg['Servers'][$i]['ssl']`
1291 Defines whether to use SSL at all. If you enable only this, the connection
1292 will be encrypted, but there is not authentication of the connection - you
1293 can not verify that you are talking to the right server.
1294 :config:option:`$cfg['Servers'][$i]['ssl_key']` and :config:option:`$cfg['Servers'][$i]['ssl_cert']`
1295 This is used for authentication of client to the server.
1296 :config:option:`$cfg['Servers'][$i]['ssl_ca']` and :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`
1297 The certificate authorities you trust for server certificates.
1298 This is used to ensure that you are talking to a trusted server.
1299 :config:option:`$cfg['Servers'][$i]['ssl_verify']`
1300 This configuration disables server certificate verification. Use with
1303 When the database server is using a local connection or private network and SSL can not be configured
1304 you can use :config:option:`$cfg['MysqlSslWarningSafeHosts']` to explicitly list the hostnames that are considered secure.
1308 :ref:`example-google-ssl`,
1309 :ref:`example-aws-ssl`,
1310 :config:option:`$cfg['Servers'][$i]['ssl']`,
1311 :config:option:`$cfg['Servers'][$i]['ssl_key']`,
1312 :config:option:`$cfg['Servers'][$i]['ssl_cert']`,
1313 :config:option:`$cfg['Servers'][$i]['ssl_ca']`,
1314 :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`,
1315 :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`,
1316 :config:option:`$cfg['Servers'][$i]['ssl_verify']`
1321 Users with column-specific privileges are unable to "Browse"
1322 ------------------------------------------------------------
1324 If a user has only column-specific privileges on some (but not all) columns in a table, "Browse"
1325 will fail with an error message.
1327 As a workaround, a bookmarked query with the same name as the table can be created, this will
1328 run when using the "Browse" link instead. `Issue 11922 <https://github.com/phpmyadmin/phpmyadmin/issues/11922>`_.
1330 Trouble logging back in after logging out using 'http' authentication
1331 ----------------------------------------------------------------------
1333 When using the 'http' ``auth_type``, it can be impossible to log back in (when the logout comes
1334 manually or after a period of inactivity). `Issue 11898 <https://github.com/phpmyadmin/phpmyadmin/issues/11898>`_.
1336 .. _Composer tool: https://getcomposer.org/
1337 .. _Packagist: https://packagist.org/
1338 .. _Docker official image: https://hub.docker.com/_/phpmyadmin