Update website

This commit is contained in:
Guilhem Lavaux 2024-11-19 08:02:04 +01:00
parent 4413528994
commit 1d90fbf296
6865 changed files with 1091082 additions and 0 deletions

View file

@ -0,0 +1,77 @@
.. _bookmarks:
Bookmarks
=========
.. note::
You need to have configured the :ref:`linked-tables` for using bookmarks
feature.
Storing bookmarks
-----------------
Any query that is executed can be marked as a bookmark on the page
where the results are displayed. You will find a button labeled
:guilabel:`Bookmark this query` just at the end of the page. As soon as you have
stored a bookmark, that query is linked to the database.
You can now access a bookmark dropdown on each page where the query box appears on for that database.
Variables inside bookmarks
--------------------------
Inside a query, you can also add placeholders for variables.
This is done by inserting into the query SQL comments between ``/*`` and
``*/``. The special string ``[VARIABLE{variable-number}]`` is used inside the comments.
Be aware that the whole query minus the SQL comments must be
valid by itself, otherwise you won't be able to store it as a bookmark.
Also, note that the text 'VARIABLE' is case-sensitive.
When you execute the bookmark, everything typed into the *Variables*
input boxes on the query box page will replace the strings ``/*[VARIABLE{variable-number}]*/`` in
your stored query.
Also remember, that everything else inside the ``/*[VARIABLE{variable-number}]*/`` string for
your query will remain the way it is, but will be stripped of the ``/**/``
chars. So you can use:
.. code-block:: mysql
/*, [VARIABLE1] AS myname */
which will be expanded to
.. code-block:: mysql
, VARIABLE1 as myname
in your query, where VARIABLE1 is the string you entered in the Variable 1 input box.
A more complex example, say you have stored this query:
.. code-block:: mysql
SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */
If you wish to enter "phpMyAdmin" as the variable for the stored query, the full
query will be:
.. code-block:: mysql
SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%'
**NOTE THE ABSENCE OF SPACES** inside the ``/**/`` construct. Any spaces
inserted there will be later also inserted as spaces in your query and may lead
to unexpected results especially when using the variable expansion inside of a
"LIKE ''" expression.
Browsing a table using a bookmark
---------------------------------
When a bookmark has the same name as the table, it will be used as the query when browsing
this table.
.. seealso::
:ref:`faqbookmark`,
:ref:`faq6_22`

View file

@ -0,0 +1,143 @@
.. _charts:
Charts
======
.. versionadded:: 3.4.0
Since phpMyAdmin version 3.4.0, you can easily generate charts from a SQL query
by clicking the "Display chart" link in the "Query results operations" area.
.. image:: images/query_result_operations.png
A window layer "Display chart" is shown in which you can customize the chart with the following options.
- Chart type: Allows you to choose the type of chart. Supported types are bar charts, column charts, line charts, spline charts, area charts, pie charts and timeline charts (only the chart types applicable for current series selection are offered).
- X-axis: Allows to choose the field for the main axis.
- Series: Allows to choose series for the chart. You can choose multiple series.
- Title: Allows specifying a title for the chart which is displayed above the chart.
- X-axis and Y-axis labels: Allows specifying labels for axes.
- Start row and a number of rows: Allows generating charts only for a specified number of rows of the results set.
.. image:: images/chart.png
Chart implementation
--------------------
Charts in phpMyAdmin are drawn using `jqPlot <http://www.jqplot.com/>`_ jQuery library.
Examples
--------
Pie chart
+++++++++
Query results for a simple pie chart can be generated with:
.. code-block:: mysql
SELECT 'Food' AS 'expense',
1250 AS 'amount' UNION
SELECT 'Accommodation', 500 UNION
SELECT 'Travel', 720 UNION
SELECT 'Misc', 220
And the result of this query is:
+---------------+--------+
| expense | amount |
+===============+========+
| Food | 1250 |
+---------------+--------+
| Accommodation | 500 |
+---------------+--------+
| Travel | 720 |
+---------------+--------+
| Misc | 220 |
+---------------+--------+
Choosing expense as the X-axis and amount in series:
.. image:: images/pie_chart.png
Bar and column chart
++++++++++++++++++++
Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking.
Query results for a simple bar or column chart can be generated with:
.. code-block:: mysql
SELECT
'ACADEMY DINOSAUR' AS 'title',
0.99 AS 'rental_rate',
20.99 AS 'replacement_cost' UNION
SELECT 'ACE GOLDFINGER', 4.99, 12.99 UNION
SELECT 'ADAPTATION HOLES', 2.99, 18.99 UNION
SELECT 'AFFAIR PREJUDICE', 2.99, 26.99 UNION
SELECT 'AFRICAN EGG', 2.99, 22.99
And the result of this query is:
+------------------+--------------+-------------------+
| title | rental_rate | replacement_cost |
+==================+==============+===================+
| ACADEMY DINOSAUR | 0.99 | 20.99 |
+------------------+--------------+-------------------+
| ACE GOLDFINGER | 4.99 | 12.99 |
+------------------+--------------+-------------------+
| ADAPTATION HOLES | 2.99 | 18.99 |
+------------------+--------------+-------------------+
| AFFAIR PREJUDICE | 2.99 | 26.99 |
+------------------+--------------+-------------------+
| AFRICAN EGG | 2.99 | 22.99 |
+------------------+--------------+-------------------+
Choosing title as the X-axis and rental_rate and replacement_cost as series:
.. image:: images/column_chart.png
Scatter chart
+++++++++++++
Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable.
Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series:
.. image:: images/scatter_chart.png
Line, spline and timeline charts
++++++++++++++++++++++++++++++++
These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration.
Query results for a simple line, spline or timeline chart can be generated with:
.. code-block:: mysql
SELECT
DATE('2006-01-08') AS 'date',
2056 AS 'revenue',
1378 AS 'cost' UNION
SELECT DATE('2006-01-09'), 1898, 2301 UNION
SELECT DATE('2006-01-15'), 1560, 600 UNION
SELECT DATE('2006-01-17'), 3457, 1565
And the result of this query is:
+------------+---------+------+
| date | revenue | cost |
+============+=========+======+
| 2016-01-08 | 2056 | 1378 |
+------------+---------+------+
| 2006-01-09 | 1898 | 2301 |
+------------+---------+------+
| 2006-01-15 | 1560 | 600 |
+------------+---------+------+
| 2006-01-17 | 3457 | 1565 |
+------------+---------+------+
.. image:: images/line_chart.png
.. image:: images/spline_chart.png
.. image:: images/timeline_chart.png

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,42 @@
.. _copyright:
Copyright
=========
.. code-block:: none
Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com>
Copyright (C) 2001-2018 Marc Delisle <marc_at_infomarc.info>
Olivier Müller <om_at_omnis.ch>
Robin Johnson <robbat2_at_users.sourceforge.net>
Alexander M. Turek <me_at_derrabus.de>
Michal Čihař <michal_at_cihar.com>
Garvin Hicking <me_at_supergarv.de>
Michael Keck <mkkeck_at_users.sourceforge.net>
Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
[check credits for more details]
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Third party licenses
++++++++++++++++++++
phpMyAdmin includes several third-party libraries which come under their
respective licenses.
jQuery's license, which is where we got the files under js/vendor/jquery/ is
(MIT|GPL), a copy of each license is available in this repository (GPL
is available as LICENSE, MIT as js/vendor/jquery/MIT-LICENSE.txt).
The download kit additionally includes several composer libraries. See their
licensing information in the vendor/ directory.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
.. _developers:
Developers Information
======================
phpMyAdmin is Open Source, so you're invited to contribute to it. Many
great features have been written by other people and you too can help
to make phpMyAdmin a useful tool.
You can check out all the possibilities to contribute in the
`contribute section on our website
<https://www.phpmyadmin.net/contribute/>`_.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,445 @@
.. _glossary:
Glossary
========
From Wikipedia, the free encyclopedia
.. glossary::
.htaccess
the default name of Apache's directory-level configuration file.
.. seealso:: <https://en.wikipedia.org/wiki/.htaccess>
ACL
Access Control List
Blowfish
a keyed, symmetric block cipher, designed in 1993 by `Bruce Schneier <https://en.wikipedia.org/wiki/Bruce_Schneier>`_.
.. seealso:: <https://en.wikipedia.org/wiki/Blowfish_(cipher)>
Browser
a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/Web_browser>
bzip2
a free software/open-source data compression algorithm and program developed by Julian Seward.
.. seealso:: <https://en.wikipedia.org/wiki/Bzip2>
CGI
Common Gateway Interface is an important World Wide Web technology that
enables a client web browser to request data from a program executed on
the web server.
.. seealso:: <https://en.wikipedia.org/wiki/Common_Gateway_Interface>
Changelog
a log or record of changes made to a project.
.. seealso:: <https://en.wikipedia.org/wiki/Changelog>
Client
a computer system that accesses a (remote) service on another computer by some kind of network.
.. seealso:: <https://en.wikipedia.org/wiki/Client_(computing)>
column
a set of data values of a particularly simple type, one for each row of the table.
.. seealso:: <https://en.wikipedia.org/wiki/Column_(database)>
Cookie
a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server.
.. seealso:: <https://en.wikipedia.org/wiki/HTTP_cookie>
CSV
Comma-separated values
.. seealso:: <https://en.wikipedia.org/wiki/Comma-separated_values>
DB
look at :term:`Database`
Database
an organized collection of data.
.. seealso:: <https://en.wikipedia.org/wiki/Database>
Engine
look at :term:`Storage Engines`
PHP extension
a PHP module that extends PHP with additional functionality.
.. seealso:: <https://en.wikipedia.org/wiki/Software_extension>
FAQ
Frequently Asked Questions is a list of commonly asked question and their
answers.
.. seealso:: <https://en.wikipedia.org/wiki/FAQ>
Field
one part of divided data/columns.
.. seealso:: <https://en.wikipedia.org/wiki/Field_(computer_science)>
Foreign key
a column or group of columns in a database row that points to a key column
or group of columns forming a key of another database row in some
(usually different) table.
.. seealso:: <https://en.wikipedia.org/wiki/Foreign_key>
GD
Graphics Library by Thomas Boutell and others for dynamically manipulating images.
.. seealso:: <https://en.wikipedia.org/wiki/GD_Graphics_Library>
GD2
look at :term:`GD`
GZip
GZip is short for GNU zip, a GNU free software file compression program.
.. seealso:: <https://en.wikipedia.org/wiki/Gzip>
host
any machine connected to a computer network, a node that has a hostname.
.. seealso:: <https://en.wikipedia.org/wiki/Host_(network)>
hostname
the unique name by which a network-attached device is known on a network.
.. seealso:: <https://en.wikipedia.org/wiki/Hostname>
HTTP
Hypertext Transfer Protocol is the primary method used to transfer or
convey information on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/HyperText_Transfer_Protocol>
HTTPS
a :term:`HTTP`-connection with additional security measures.
.. seealso:: <https://en.wikipedia.org/wiki/HTTPS>
IEC
International Electrotechnical Commission
IIS
Internet Information Services is a set of internet-based services for
servers using Microsoft Windows.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Information_Services>
Index
a feature that allows quick access to the rows in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Database_index>
IP
"Internet Protocol" is a data-oriented protocol used by source and
destination hosts for communicating data across a packet-switched
internetwork.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Protocol>
IP Address
a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard.
.. seealso:: <https://en.wikipedia.org/wiki/IP_Address>
IPv6
IPv6 (Internet Protocol version 6) is the latest revision of the
Internet Protocol (:term:`IP`), designed to deal with the
long-anticipated problem of its predecessor IPv4 running out of addresses.
.. seealso:: <https://en.wikipedia.org/wiki/IPv6>
ISAPI
Internet Server Application Programming Interface is the API of Internet Information Services (IIS).
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Server_Application_Programming_Interface>
ISP
An Internet service provider is a business or organization that offers users
access to the Internet and related services.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_service_provider>
ISO
International Standards Organization
.. seealso:: `ISO organization website <https://www.iso.org/about-us.html>`_
.. seealso:: <https://en.wikipedia.org/wiki/International_Organization_for_Standardization>
JPEG
a most commonly used standard method of lossy compression for photographic images.
.. seealso:: <https://en.wikipedia.org/wiki/JPEG>
JPG
look at :term:`JPEG`
Key
look at :term:`Index`
LATEX
a document preparation system for the TeX typesetting program.
.. seealso:: <https://en.wikipedia.org/wiki/LaTeX>
Mac
Apple Macintosh is a line of personal computers designed, developed, manufactured, and marketed by Apple Inc.
.. seealso:: <https://en.wikipedia.org/wiki/Macintosh>
macOS
the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets.
.. seealso:: <https://en.wikipedia.org/wiki/MacOS>
mbstring
The PHP `mbstring` functions provide support for languages represented by multi-byte character sets, most notably UTF-8.
If you have troubles installing this extension, please follow :ref:`faqmysql`, it provides useful hints.
.. seealso:: <https://www.php.net/manual/en/book.mbstring.php>
Media type
A media type (formerly known as MIME type) is a two-part identifier
for file formats and format contents transmitted on the Internet.
.. seealso:: <https://en.wikipedia.org/wiki/Media_type>
MIME
Multipurpose Internet Mail Extensions is
an Internet Standard for the format of e-mail.
.. seealso:: <https://en.wikipedia.org/wiki/MIME>
module
modular extension for the Apache HTTP Server httpd.
.. seealso:: <https://en.wikipedia.org/wiki/Apache_HTTP_Server>
mod_proxy_fcgi
an Apache module implementing a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or
directly as an Apache module.
.. seealso:: <https://en.wikipedia.org/wiki/Mod_proxy>
MySQL
a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS).
.. seealso:: <https://en.wikipedia.org/wiki/MySQL>
MySQLi
the improved MySQL client PHP extension.
.. seealso:: `PHP manual for MySQL Improved Extension <https://www.php.net/manual/en/book.mysqli.php>`_
.. seealso:: <https://en.wikipedia.org/wiki/MySQLi>
mysql
the MySQL client PHP extension.
.. seealso:: <https://www.php.net/manual/en/book.mysql.php>
OpenDocument
an open standard for office documents.
.. seealso:: <https://en.wikipedia.org/wiki/OpenDocument>
OS X
look at :term:`macOS`.
.. seealso:: <https://en.wikipedia.org/wiki/MacOS>
PDF
Portable Document Format is a file format developed by Adobe Systems for
representing two-dimensional documents in a device-independent and
resolution-independent format.
.. seealso:: <https://en.wikipedia.org/wiki/PDF>
PEAR
the PHP Extension and Application Repository.
.. seealso:: `PEAR website <https://pear.php.net/>`_
.. seealso:: `Wikipedia page for PEAR <https://en.wikipedia.org/wiki/PEAR>`_
PCRE
Perl-Compatible Regular Expressions is the Perl-compatible regular
expression functions for PHP
.. seealso:: <https://www.php.net/pcre>
.. seealso:: `PHP manual for Perl-Compatible Regular Expressions <https://www.php.net/pcre>`_
.. seealso:: <https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions>
PHP
short for "PHP: Hypertext Preprocessor", is an open-source, reflective
programming language used mainly for developing server-side applications
and dynamic web content, and more recently, a broader range of software
applications.
.. seealso:: <https://en.wikipedia.org/wiki/PHP>
port
a connection through which data is sent and received.
.. seealso:: <https://en.wikipedia.org/wiki/Port_(computer_networking)>
primary key
A primary key is an index over one or more fields in a table with
unique values for every single row in this table. Every table should have
a primary key for easier accessing/identifying data in this table. There
can only be one primary key per table and it is named always **PRIMARY**.
In fact, a primary key is just an :term:`unique key` with the name
**PRIMARY**. If no primary key is defined MySQL will use first *unique
key* as primary key if there is one.
You can create the primary key when creating the table (in phpMyAdmin
just check the primary key radio buttons for each field you wish to be
part of the primary key).
You can also add a primary key to an existing table with `ALTER` `TABLE`
or `CREATE` `INDEX` (in phpMyAdmin you can just click on 'add index' on
the table structure page below the listed fields).
RFC
Request for Comments (RFC) documents are a series of memoranda
encompassing new research, innovations, and methodologies applicable to
Internet technologies.
.. seealso:: <https://en.wikipedia.org/wiki/Request_for_Comments>
RFC 1952
GZIP file format specification version 4.3
.. seealso:: :rfc:`1952`
Row (record, tuple)
represents a single, implicitly structured data item in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Row_(database)>
Server
a computer system that provides services to other computing systems over a network.
.. seealso:: <https://en.wikipedia.org/wiki/Server_(computing)>
Sodium
The Sodium PHP extension.
.. seealso:: `PHP manual for Sodium extension <https://www.php.net/manual/en/book.sodium.php>`_
Storage Engines
MySQL can use several different formats for storing data on disk, these
are called storage engines or table types. phpMyAdmin allows a user to
change their storage engine for a particular table through the operations
tab.
Common table types are InnoDB and MyISAM, though many others exist and
may be desirable in some situations.
.. seealso:: `MySQL doc chapter about Alternative Storage Engines <https://dev.mysql.com/doc/refman/8.0/en/storage-engines.html>`_
.. seealso:: <https://en.wikipedia.org/wiki/Database_engine>
socket
a form of inter-process communication.
.. seealso:: <https://en.wikipedia.org/wiki/Unix_domain_socket>
SSL
Secure Sockets Layer, (now superseded by TLS) is a cryptographic protocol
which provides secure communication on the Internet.
.. seealso:: <https://en.wikipedia.org/wiki/Transport_Layer_Security>
Stored procedure
a subroutine available to applications accessing a relational database system
.. seealso:: <https://en.wikipedia.org/wiki/Stored_procedure>
SQL
Structured Query Language
.. seealso:: <https://en.wikipedia.org/wiki/SQL>
table
a set of data elements (cells) that is organized, defined and stored as
horizontal rows and vertical columns where each item can be uniquely
identified by a label or key or by its position in relation to other
items.
.. seealso:: <https://en.wikipedia.org/wiki/Table_(database)>
tar
a type of archive file format, from "Tape Archive".
.. seealso:: <https://en.wikipedia.org/wiki/Tar_(computing)>
TCP
Transmission Control Protocol is one of the core protocols of the
Internet protocol suite.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_protocol_suite>
TCPDF
PHP library to generate PDF files.
.. seealso:: <https://tcpdf.org/>
.. seealso:: <https://en.wikipedia.org/wiki/TCPDF>
trigger
a procedural code that is automatically executed in response to certain events on a particular table or view in a database
.. seealso:: <https://en.wikipedia.org/wiki/Database_trigger>
unique key
A unique key is an index over one or more fields in a table which has a
unique value for each row. The first unique key will be treated as
:term:`primary key` if there is no *primary key* defined.
URL
Uniform Resource Locator is a sequence of characters, conforming to a
standardized format, that is used for referring to resources, such as
documents and images on the Internet, by their location.
.. seealso:: <https://en.wikipedia.org/wiki/URL>
Web server
A computer (program) that is responsible for accepting HTTP requests from clients and serving them web pages.
.. seealso:: <https://en.wikipedia.org/wiki/Web_server>
XML
Extensible Markup Language is a W3C-recommended general-purpose markup
language for creating special-purpose markup languages, capable of
describing many different kinds of data.
.. seealso:: <https://en.wikipedia.org/wiki/XML>
ZIP
a popular data compression and archival format.
.. seealso:: <https://en.wikipedia.org/wiki/Zip_(file_format)>
Zlib
an open-source, cross-platform data compression library by `Jean-loup Gailly <https://en.wikipedia.org/wiki/Jean-Loup_Gailly>`_ and `Mark Adler <https://en.wikipedia.org/wiki/Mark_Adler>`_.
.. seealso:: <https://en.wikipedia.org/wiki/Zlib>
Content Security Policy
The HTTP `Content-Security-Policy` response header allows web site administrators
to control resources the user agent is allowed to load for a given page.
.. seealso:: <https://en.wikipedia.org/wiki/Content_Security_Policy>
.. seealso:: <https://developer.mozilla.org/en/docs/Web/HTTP/CSP>

View file

@ -0,0 +1,346 @@
Import and export
=================
Import
++++++
To import data, go to the "Import" tab in phpMyAdmin. To import data into a
specific database or table, open the database or table before going to the
"Import" tab.
In addition to the standard Import and Export tab, you can also import an SQL
file directly by dragging and dropping it from your local file manager to the
phpMyAdmin interface in your web browser.
If you are having troubles importing big files, please consult :ref:`faq1_16`.
You can import using following methods:
Form based upload
Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .
Form based SQL Query
Can be used with valid SQL dumps.
Using upload directory
You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin, see :config:option:`$cfg['UploadDir']`.
phpMyAdmin can import from several various commonly used formats.
CSV
---
Comma separated values format which is often used by spreadsheets or various other programs for export/import.
.. note::
When importing data into a table from a CSV file where the table has an
'auto_increment' field, make the 'auto_increment' value for each record in
the CSV field to be '0' (zero). This allows the 'auto_increment' field to
populate correctly.
It is now possible to import a CSV file at the server or database level.
Instead of having to create a table to import the CSV file into, a best-fit
structure will be determined for you and the data imported into it, instead.
All other features, requirements, and limitations are as before.
CSV using LOAD DATA
-------------------
Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.
ESRI Shape File
---------------
The ESRI shapefile or simply a shapefile is a popular geospatial vector data
format for geographic information systems software. It is developed and
regulated by Esri as a (mostly) open specification for data interoperability
among Esri and other software products.
MediaWiki
---------
MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later),
can now also be imported. This is the format used by Wikipedia to display
tables.
Open Document Spreadsheet (ODS)
-------------------------------
OpenDocument workbooks containing one or more spreadsheets can now be directly imported.
When importing an ODS spreadsheet, the spreadsheet must be named in a specific way in order to make the
import as simple as possible.
Table name
~~~~~~~~~~
During import, phpMyAdmin uses the sheet name as the table name; you should rename the
sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
though this is less of a concern since you could quickly rename the new table from the Operations tab).
Column names
~~~~~~~~~~~~
You should also make the first row of your spreadsheet a header with the names of the columns (this can be
accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
checkbox for "The first line of the file contains the table column names;" this way your newly imported
data will go to the proper columns.
.. note::
Formulas and calculations will NOT be evaluated, rather, their value from
the most recent save will be loaded. Please ensure that all values in the
spreadsheet are as needed before importing it.
SQL
---
SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.
XML
---
XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported.
Structures (databases, tables, views, triggers, etc.) and/or data will be
created depending on the contents of the file.
The supported xml schemas are not yet documented in this wiki.
Export
++++++
phpMyAdmin can export into text files (even compressed) on your local disk (or
a special the webserver :config:option:`$cfg['SaveDir']` folder) in various
commonly used formats:
CodeGen
-------
`NHibernate <https://en.wikipedia.org/wiki/NHibernate>`_ file format. Planned
versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is
codegen.
CSV
---
Comma separated values format which is often used by spreadsheets or various
other programs for export/import.
CSV for Microsoft Excel
-----------------------
This is just preconfigured version of CSV export which can be imported into
most English versions of Microsoft Excel. Some localised versions (like
"Danish") are expecting ";" instead of "," as field separator.
Microsoft Word 2000
-------------------
If you're using Microsoft Word 2000 or newer (or compatible such as
OpenOffice.org), you can use this export.
JSON
----
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It
is easy for humans to read and write and it is easy for machines to parse and
generate.
.. versionchanged:: 4.7.0
The generated JSON structure has been changed in phpMyAdmin 4.7.0 to
produce valid JSON data.
The generated JSON is list of objects with following attributes:
.. js:data:: type
Type of given object, can be one of:
``header``
Export header containing comment and phpMyAdmin version.
``database``
Start of a database marker, containing name of database.
``table``
Table data export.
.. js:data:: version
Used in ``header`` :js:data:`type` and indicates phpMyAdmin version.
.. js:data:: comment
Optional textual comment.
.. js:data:: name
Object name - either table or database based on :js:data:`type`.
.. js:data:: database
Database name for ``table`` :js:data:`type`.
.. js:data:: data
Table content for ``table`` :js:data:`type`.
Sample output:
.. code-block:: json
[
{
"comment": "Export to JSON plugin for PHPMyAdmin",
"type": "header",
"version": "4.7.0-dev"
},
{
"name": "cars",
"type": "database"
},
{
"data": [
{
"car_id": "1",
"description": "Green Chrysler 300",
"make_id": "5",
"mileage": "113688",
"price": "13545.00",
"transmission": "automatic",
"yearmade": "2007"
}
],
"database": "cars",
"name": "cars",
"type": "table"
},
{
"data": [
{
"make": "Chrysler",
"make_id": "5"
}
],
"database": "cars",
"name": "makes",
"type": "table"
}
]
LaTeX
-----
If you want to embed table data or structure in LaTeX, this is right choice for you.
LaTeX is a typesetting system that is very suitable for producing scientific
and mathematical documents of high typographical quality. It is also suitable
for producing all sorts of other documents, from simple letters to complete
books. LaTeX uses TeX as its formatting engine. Learn more about TeX and
LaTeX on `the Comprehensive TeX Archive Network <https://www.ctan.org/>`_
also see the `short description od TeX <https://www.ctan.org/tex/>`_.
The output needs to be embedded into a LaTeX document before it can be
rendered, for example in following document:
.. code-block:: latex
\documentclass{article}
\title{phpMyAdmin SQL output}
\author{}
\usepackage{longtable,lscape}
\date{}
\setlength{\parindent}{0pt}
\usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry}
\pdfpagewidth 210mm
\pdfpageheight 297mm
\begin{document}
\maketitle
% insert phpMyAdmin LaTeX Dump here
\end{document}
MediaWiki
---------
Both tables and databases can be exported in the MediaWiki format, which is
used by Wikipedia to display tables. It can export structure, data or both,
including table names or headers.
OpenDocument Spreadsheet
------------------------
Open standard for spreadsheet data, which is being widely adopted. Many recent
spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or
Google Docs can handle this format.
OpenDocument Text
-----------------
New standard for text data which is being widely adopted. Most recent word
processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord)
can handle this.
PDF
---
For presentation purposes, non editable PDF might be best choice for you.
PHP Array
---------
You can generate a php file which will declare a multidimensional array with
the contents of the selected table or database.
SQL
---
Export in SQL can be used to restore your database, thus it is useful for
backing up.
The option 'Maximal length of created query' seems to be undocumented. But
experiments has shown that it splits large extended INSERTS so each one is no
bigger than the given number of bytes (or characters?). Thus when importing the
file, for large tables you avoid the error "Got a packet bigger than
'max_allowed_packet' bytes".
.. seealso::
https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html
Data Options
~~~~~~~~~~~~
**Complete inserts** adds the column names to the SQL dump. This parameter
improves the readability and reliability of the dump. Adding the column names
increases the size of the dump, but when combined with Extended inserts it's
negligible.
**Extended inserts** combines multiple rows of data into a single INSERT query.
This will significantly decrease filesize for large SQL dumps, increases the
INSERT speed when imported, and is generally recommended.
Texy!
-----
`Texy! <https://texy.info/>`_ markup format. You can see example on `Texy! demo
<https://texy.info/en/try/4q5we>`_.
XML
---
Easily parsable export for use with custom scripts.
.. versionchanged:: 3.3.0
The XML schema used has changed as of version 3.3.0
YAML
----
YAML is a data serialization format which is both human readable and
computationally powerful ( <https://yaml.org> ).

View file

@ -0,0 +1,32 @@
.. phpMyAdmin documentation master file, created by
sphinx-quickstart on Wed Sep 26 14:04:48 2012.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to phpMyAdmin's documentation!
======================================
Contents:
.. toctree::
:maxdepth: 2
intro
require
setup
config
user
faq
developers
security
vendors
copyright
credits
glossary
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`
* :ref:`glossary`

View file

@ -0,0 +1,79 @@
.. _intro:
Introduction
============
phpMyAdmin is a free software tool written in PHP that is intended to handle the
administration of a MySQL or MariaDB database server. You can use phpMyAdmin to
perform most administration tasks, including creating a database, running queries,
and adding user accounts.
Supported features
------------------
Currently phpMyAdmin can:
* create, browse, edit, and drop databases, tables, views, columns, and indexes
* display multiple results sets through stored procedures or queries
* create, copy, drop, rename and alter databases, tables, columns and
indexes
* maintenance server, databases and tables, with proposals on server
configuration
* execute, edit and bookmark any :term:`SQL`-statement, even batch-queries
* load text files into tables
* create [#f1]_ and read dumps of tables
* export [#f1]_ data to various formats: :term:`CSV`, :term:`XML`, :term:`PDF`,
:term:`ISO`/:term:`IEC` 26300 - :term:`OpenDocument` Text and Spreadsheet, Microsoft
Word 2000, and LATEX formats
* import data and :term:`MySQL` structures from :term:`OpenDocument` spreadsheets, as
well as :term:`XML`, :term:`CSV`, and :term:`SQL` files
* administer multiple servers
* add, edit, and remove MySQL user accounts and privileges
* check referential integrity in MyISAM tables
* using Query-by-example (QBE), create complex queries automatically
connecting required tables
* create :term:`PDF` graphics of your
database layout
* search globally in a database or a subset of it
* transform stored data into any format using a set of predefined
functions, like displaying BLOB-data as image or download-link
* track changes on databases, tables and views
* support InnoDB tables and foreign keys
* support mysqli, the improved MySQL extension see :ref:`faq1_17`
* create, edit, call, export and drop stored procedures and functions
* create, edit, export and drop events and triggers
* communicate in `80 different languages
<https://www.phpmyadmin.net/translations/>`_
Shortcut keys
-------------
Currently phpMyAdmin supports following shortcuts:
* k - Toggle console
* h - Go to home page
* s - Open settings
* d + s - Go to database structure (Provided you are in database related page)
* d + f - Search database (Provided you are in database related page)
* t + s - Go to table structure (Provided you are in table related page)
* t + f - Search table (Provided you are in table related page)
* backspace - Takes you to older page.
A word about users
------------------
Many people have difficulty understanding the concept of user
management with regards to phpMyAdmin. When a user logs in to
phpMyAdmin, that username and password are passed directly to MySQL.
phpMyAdmin does no account management on its own (other than allowing
one to manipulate the MySQL user account information); all users must
be valid MySQL users.
.. rubric:: Footnotes
.. [#f1]
phpMyAdmin can compress (:term:`ZIP`, :term:`GZip` or :term:`RFC 1952`
formats) dumps and :term:`CSV` exports if you use PHP with
:term:`Zlib` support (``--with-zlib``).
Proper support may also need changes in :file:`php.ini`.

View file

@ -0,0 +1,32 @@
Other sources of information
============================
Printed Book
------------
The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for
Effective MySQL Management by Marc Delisle. You can get information on that
book and other officially endorsed `books at the phpMyAdmin site`_.
.. _books at the phpMyAdmin site: https://www.phpmyadmin.net/docs/
Tutorials
---------
Third party tutorials and articles which you might find interesting:
Česky (Czech)
+++++++++++++
- `Seriál o phpMyAdminovi <https://cihar.com/publications/linuxsoft/>`_
English
+++++++
- `Having fun with phpMyAdmin's MIME-transformations & PDF-features <https://garv.in/tops/texte/mimetutorial>`_
- `Learning SQL Using phpMyAdmin (old tutorial) <http://www.php-editors.com/articles/sql_phpmyadmin.php>`_
Русский (Russian)
+++++++++++++++++
* `Russian server about phpMyAdmin <https://php-myadmin.ru/>`_

View file

@ -0,0 +1,74 @@
User management
===============
User management is the process of controlling which users are allowed to
connect to the MySQL server and what permissions they have on each database.
phpMyAdmin does not handle user management, rather it passes the username and
password on to MySQL, which then determines whether a user is permitted to
perform a particular action. Within phpMyAdmin, administrators have full
control over creating users, viewing and editing privileges for existing users,
and removing users.
Within phpMyAdmin, user management is controlled via the :guilabel:`User accounts` tab
from the main page. Users can be created, edited, and removed.
Creating a new user
-------------------
To create a new user, click the :guilabel:`Add user account` link near the bottom
of the :guilabel:`User accounts` page (you must be a "superuser", e.g., user "root").
Use the textboxes and drop-downs to configure the user to your particular
needs. You can then select whether to create a database for that user and grant
specific global privileges. Once you've created the user (by clicking Go), you
can define that user's permissions on a specific database (don't grant global
privileges in that case). In general, users do not need any global privileges
(other than USAGE), only permissions for their specific database.
Editing an existing user
------------------------
To edit an existing user, simply click the pencil icon to the right of that
user in the :guilabel:`User accounts` page. You can then edit their global- and
database-specific privileges, change their password, or even copy those
privileges to a new user.
Deleting a user
---------------
From the :guilabel:`User accounts` page, check the checkbox for the user you wish to
remove, select whether or not to also remove any databases of the same name (if
they exist), and click Go.
Assigning privileges to user for a specific database
----------------------------------------------------
Users are assigned to databases by editing the user record (from the
:guilabel:`User accounts` link on the home page).
If you are creating a user specifically for a given table
you will have to create the user first (with no global privileges) and then go
back and edit that user to add the table and privileges for the individual
table.
.. _configurablemenus:
Configurable menus and user groups
----------------------------------
By enabling :config:option:`$cfg['Servers'][$i]['users']` and
:config:option:`$cfg['Servers'][$i]['usergroups']` you can customize what users
will see in the phpMyAdmin navigation.
.. warning::
This feature only limits what a user sees, they are still able to use all the
functions. So this can not be considered as a security limitation. Should
you want to limit what users can do, use MySQL privileges to achieve that.
With this feature enabled, the :guilabel:`User accounts` management interface gains
a second tab for managing :guilabel:`User groups`, where you can define what each
group will view (see image below) and you can then assign each user to one of
these groups. Users will be presented with a simplified user interface, which might be
useful for inexperienced users who could be overwhelmed by all the features
phpMyAdmin provides.
.. image:: images/usergroups.png

View file

@ -0,0 +1,84 @@
.. _relations:
Relations
=========
phpMyAdmin allows relationships (similar to foreign keys) using MySQL-native
(InnoDB) methods when available and falling back on special phpMyAdmin-only
features when needed. There are two ways of editing these relations, with the
*relation view* and the drag-and-drop *designer* -- both of which are explained
on this page.
.. note::
You need to have configured the :ref:`linked-tables` for using phpMyAdmin
only relations.
Technical info
--------------
Currently the only MySQL table type that natively supports relationships is
InnoDB. When using an InnoDB table, phpMyAdmin will create real InnoDB
relations which will be enforced by MySQL no matter which application accesses
the database. In the case of any other table type, phpMyAdmin enforces the
relations internally and those relations are not applied to any other
application.
Relation view
-------------
In order to get it working, you first have to properly create the
[[pmadb|pmadb]]. Once that is setup, select a table's "Structure" page. Below
the table definition, a link called "Relation view" is shown. If you click that
link, a page will be shown that offers you to create a link to another table
for any (most) fields. Only PRIMARY KEYS are shown there, so if the field you
are referring to is not shown, you most likely are doing something wrong. The
drop-down at the bottom is the field which will be used as the name for a
record.
Relation view example
+++++++++++++++++++++
.. image:: images/pma-relations-relation-view-link.png
.. image:: images/pma-relations-relation-link.png
Let's say you have categories and links and one category can contain several links. Your table structure would be something like this:
- `category.category_id` (must be unique)
- `category.name`
- `link.link_id`
- `link.category_id`
- `link.uri`.
Open the relation view (below the table structure) page for the `link` table and for `category_id` field, you select `category.category_id` as master record.
If you now browse the link table, the `category_id` field will be a clickable hyperlink to the proper category record. But all you see is just the `category_id`, not the name of the category.
.. image:: images/pma-relations-relation-name.png
To fix this, open the relation view of the `category` table and in the drop down at the bottom, select "name". If you now browse the link table again and hover the mouse over the `category_id` hyperlink, the value from the related category will be shown as tooltip.
.. image:: images/pma-relations-links.png
Designer
--------
The Designer feature is a graphical way of creating, editing, and displaying
phpMyAdmin relations. These relations are compatible with those created in
phpMyAdmin's relation view.
To use this feature, you need a properly configured :ref:`linked-tables` and
must have the :config:option:`$cfg['Servers'][$i]['table_coords']` configured.
To use the designer, select a database's structure page, then look for the
:guilabel:`Designer` tab.
To export the view into PDF, you have to create PDF pages first. The Designer
creates the layout, how the tables shall be displayed. To finally export the
view, you have to create this with a PDF page and select your layout, which you
have created with the designer.
.. seealso::
:ref:`faqpdf`

View file

@ -0,0 +1,65 @@
.. _require:
Requirements
============
Web server
----------
Since phpMyAdmin's interface is based entirely in your browser, you'll need a
web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files into.
PHP
---
* You need PHP 7.2.5 or newer, with ``session`` support, the Standard PHP Library
(SPL) extension, hash, ctype, and JSON support.
* The ``mbstring`` extension (see :term:`mbstring`) is strongly recommended
for performance reasons.
* To support uploading of ZIP files, you need the PHP ``zip`` extension.
* You need GD2 support in PHP to display inline thumbnails of JPEGs
("image/jpeg: inline") with their original aspect ratio.
* When using the cookie authentication (the default), the `openssl
<https://www.php.net/openssl>`_ extension is strongly suggested.
* To support upload progress bars, see :ref:`faq2_9`.
* To support XML and Open Document Spreadsheet importing, you need the
`libxml <https://www.php.net/libxml>`_ extension.
* To support reCAPTCHA on the login page, you need the
`openssl <https://www.php.net/openssl>`_ extension.
* To support displaying phpMyAdmin's latest version, you need to enable
``allow_url_open`` in your :file:`php.ini` or to have the
`curl <https://www.php.net/curl>`_ extension.
.. seealso:: :ref:`faq1_31`, :ref:`authentication_modes`
Database
--------
phpMyAdmin supports MySQL-compatible databases.
* MySQL 5.5 or newer
* MariaDB 5.5 or newer
.. seealso:: :ref:`faq1_17`
Web browser
-----------
To access phpMyAdmin you need a web browser with cookies and JavaScript
enabled.
You need a browser which is supported by Bootstrap 4.5, see
<https://getbootstrap.com/docs/4.5/getting-started/browsers-devices/>.
.. versionchanged:: 5.2.0
You need a browser which is supported by Bootstrap 5.0, see
<https://getbootstrap.com/docs/5.0/getting-started/browsers-devices/>.

View file

@ -0,0 +1,113 @@
Security policy
===============
The phpMyAdmin developer team is putting lot of effort to make phpMyAdmin as
secure as possible. But still web application like phpMyAdmin can be vulnerable
to a number of attacks and new ways to exploit are still being explored.
For every reported vulnerability we issue a phpMyAdmin Security Announcement
(PMASA) and it get's assigned a CVE ID as well. We might group similar
vulnerabilities to one PMASA (eg. multiple XSS vulnerabilities can be announced
under one PMASA).
If you think you've found a vulnerability, please see :ref:`reporting-security`.
Typical vulnerabilities
-----------------------
In this section, we will describe typical vulnerabilities, which can appear in
our code base. This list is by no means complete, it is intended to show
typical attack surface.
Cross-site scripting (XSS)
++++++++++++++++++++++++++
When phpMyAdmin shows a piece of user data, e.g. something inside a user's
database, all html special chars have to be escaped. When this escaping is
missing somewhere a malicious user might fill a database with specially crafted
content to trick an other user of that database into executing something. This
could for example be a piece of JavaScript code that would do any number of
nasty things.
phpMyAdmin tries to escape all userdata before it is rendered into html for the
browser.
.. seealso::
`Cross-site scripting on Wikipedia <https://en.wikipedia.org/wiki/Cross-site_scripting>`_
Cross-site request forgery (CSRF)
+++++++++++++++++++++++++++++++++
An attacker would trick a phpMyAdmin user into clicking on a link to provoke
some action in phpMyAdmin. This link could either be sent via email or some
random website. If successful this the attacker would be able to perform some
action with the users privileges.
To mitigate this phpMyAdmin requires a token to be sent on sensitive requests.
The idea is that an attacker does not poses the currently valid token to
include in the presented link.
The token is regenerated for every login, so it's generally valid only for
limited time, what makes it harder for attacker to obtain valid one.
.. seealso::
`Cross-site request forgery on Wikipedia <https://en.wikipedia.org/wiki/Cross-site_request_forgery>`_
SQL injection
+++++++++++++
As the whole purpose of phpMyAdmin is to preform sql queries, this is not our
first concern. SQL injection is sensitive to us though when it concerns the
mysql control connection. This controlconnection can have additional privileges
which the logged in user does not poses. E.g. access the :ref:`linked-tables`.
User data that is included in (administrative) queries should always be run
through DatabaseInterface::escapeString().
.. seealso::
`SQL injection on Wikipedia <https://en.wikipedia.org/wiki/SQL_injection>`_
Brute force attack
++++++++++++++++++
phpMyAdmin on its own does not rate limit authentication attempts in any way.
This is caused by need to work in stateless environment, where there is no way
to protect against such kind of things.
To mitigate this, you can use Captcha or utilize external tools such as
fail2ban, this is more details described in :ref:`securing`.
.. seealso::
`Brute force attack on Wikipedia <https://en.wikipedia.org/wiki/Brute-force_attack>`_
.. _reporting-security:
Reporting security issues
-------------------------
Should you find a security issue in the phpMyAdmin programming code, please
contact the `phpMyAdmin security team <mailto:security@phpmyadmin.net>`_ in
advance before publishing it. This way we can prepare a fix and release the fix together with your
announcement. You will be also given credit in our security announcement.
You can optionally encrypt your report with PGP key ID
``DA68AB39218AB947`` with following fingerprint:
.. code-block:: console
pub 4096R/DA68AB39218AB947 2016-08-02
Key fingerprint = 5BAD 38CF B980 50B9 4BD7 FB5B DA68 AB39 218A B947
uid phpMyAdmin Security Team <security@phpmyadmin.net>
sub 4096R/5E4176FB497A31F7 2016-08-02
The key can be either obtained from the keyserver or is available in
`phpMyAdmin keyring <https://files.phpmyadmin.net/phpmyadmin.keyring>`_
available on our download server or using `Keybase <https://keybase.io/phpmyadmin_sec>`_.
Should you have suggestion on improving phpMyAdmin to make it more secure, please
report that to our `issue tracker <https://github.com/phpmyadmin/phpmyadmin/issues>`_.
Existing improvement suggestions can be found by
`hardening label <https://github.com/phpmyadmin/phpmyadmin/labels/hardening>`_.

View file

@ -0,0 +1,21 @@
Configuring phpMyAdmin
----------------------
There are many configuration settings that can be used to customize the
interface. Those settings are described in
:ref:`config`. There are several layers of the configuration.
The global settings can be configured in :file:`config.inc.php` as described in
:ref:`config`. This is only way to configure connections to databases and other
system wide settings.
On top of this there are user settings which can be persistently stored in
:ref:`linked-tables`, possibly automatically configured through
:ref:`zeroconf`. If the :ref:`linked-tables` are not configured, the settings
are temporarily stored in the session data; these are valid only until you
logout.
You can also save the user configuration for further use, either download them
as a file or to the browser local storage. You can find both those options in
the :guilabel:`Settings` tab. The settings stored in browser local storage will
be automatically offered for loading upon your login to phpMyAdmin.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,100 @@
.. _themes:
Custom Themes
=============
phpMyAdmin comes with support for third party themes. You can download
additional themes from our website at <https://www.phpmyadmin.net/themes/>.
Configuration
-------------
Themes are configured with :config:option:`$cfg['ThemeManager']` and
:config:option:`$cfg['ThemeDefault']`. Under :file:`./themes/`, you should not
delete the directory ``pmahomme`` or its underlying structure, because this is
the system theme used by phpMyAdmin. ``pmahomme`` contains all images and
styles, for backwards compatibility and for all themes that would not include
images or css-files. If :config:option:`$cfg['ThemeManager']` is enabled, you
can select your favorite theme on the main page. Your selected theme will be
stored in a cookie.
Creating custom theme
---------------------
To create a theme:
* make a new subdirectory (for example "your\_theme\_name") under :file:`./themes/`.
* copy the files and directories from ``pmahomme`` to "your\_theme\_name"
* edit the css-files in "your\_theme\_name/css"
* put your new images in "your\_theme\_name/img"
* edit :file:`_variables.scss` in "your\_theme\_name/scss"
* edit :file:`theme.json` in "your\_theme\_name" to contain theme metadata (see below)
* make a new screenshot of your theme and save it under
"your\_theme\_name/screen.png"
Theme metadata
++++++++++++++
.. versionchanged:: 4.8.0
Before 4.8.0 the theme metadata was passed in the :file:`info.inc.php` file.
It has been replaced by :file:`theme.json` to allow easier parsing (without
need to handle PHP code) and to support additional features.
In theme directory there is file :file:`theme.json` which contains theme
metadata. Currently it consists of:
.. describe:: name
Display name of the theme.
**This field is required.**
.. describe:: version
Theme version, can be quite arbitrary and does not have to match phpMyAdmin version.
**This field is required.**
.. describe:: description
Theme description. this will be shown on the website.
**This field is required.**
.. describe:: author
Theme author name.
**This field is required.**
.. describe:: url
Link to theme author website. It's good idea to have way for getting
support there.
.. describe:: supports
Array of supported phpMyAdmin major versions.
**This field is required.**
For example, the definition for Original theme shipped with phpMyAdmin 4.8:
.. code-block:: json
{
"name": "Original",
"version": "4.8",
"description": "Original phpMyAdmin theme",
"author": "phpMyAdmin developers",
"url": "https://www.phpmyadmin.net/",
"supports": ["4.8"]
}
Sharing images
++++++++++++++
If you do not want to use your own symbols and buttons, remove the
directory "img" in "your\_theme\_name". phpMyAdmin will use the
default icons and buttons (from the system-theme ``pmahomme``).

View file

@ -0,0 +1,158 @@
.. _transformations:
Transformations
===============
.. note::
You need to have configured the :ref:`linked-tables` to use the transformations
feature.
.. _transformationsintro:
Introduction
++++++++++++
To enable transformations, you have to set up the ``column_info``
table and the proper directives. Please see the :ref:`config` on how to do so.
phpMyAdmin has two different types of transformations: browser display
transformations, which affect only how the data is shown when browsing
through phpMyAdmin; and input transformations, which affect a value
prior to being inserted through phpMyAdmin.
You can apply different transformations to the contents of each
column. Each transformation has options to define how it will affect the
stored data.
Say you have a column ``filename`` which contains a filename. Normally
you would see in phpMyAdmin only this filename. Using display transformations
you can transform that filename into a HTML link, so you can click
inside of the phpMyAdmin structure on the column's link and will see
the file displayed in a new browser window. Using transformation
options you can also specify strings to append/prepend to a string or
the format you want the output stored in.
For a general overview of all available transformations and their
options, you can either go to the ``Change`` link for an existing column
or from the dialog to create a new column, in either case there is a link
on that column structure page for "Browser display transformation" and
"Input transformation" which will show more information about each
transformation that is available on your system.
For a tutorial on how to effectively use transformations, see our
`Link section <https://www.phpmyadmin.net/docs/>`_ on the
official phpMyAdmin homepage.
.. _transformationshowto:
Usage
+++++
Go to the table structure page (reached by clicking on
the 'Structure' link for a table). There click on "Change" (or the change
icon) and there you will see the five transformation--related fields at the end of the line.
They are called ':term:`Media type`', 'Browser transformation' and
'Transformation options'.
* The field ':term:`Media type`' is a drop-down field. Select the :term:`Media type` that
corresponds to the column's contents. Please note that many transformations
are inactive until a :term:`Media type` is selected.
* The field 'Browser display transformation' is a drop-down field. You can
choose from a hopefully growing amount of pre-defined transformations.
See below for information on how to build your own transformation.
There are global transformations and mimetype-bound transformations.
Global transformations can be used for any mimetype. They will take
the mimetype, if necessary, into regard. Mimetype-bound
transformations usually only operate on a certain mimetype. There are
transformations which operate on the main mimetype (like 'image'),
which will most likely take the subtype into regard, and those who
only operate on a specific subtype (like 'image/jpeg'). You can use
transformations on mimetypes for which the function was not defined
for. There is no security check for you selected the right
transformation, so take care of what the output will be like.
* The field 'Browser display transformation options' is a free-type textfield. You have
to enter transform-function specific options here. Usually the
transforms can operate with default options, but it is generally a
good idea to look up the overview to see which options are necessary.
Much like the ENUM/SET-Fields, you have to split up several options
using the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is
because internally the options will be parsed as an array, leaving the
first value the first element in the array, and so forth. If you want
to specify a MIME character set you can define it in the
transformation\_options. You have to put that outside of the pre-
defined options of the specific mime-transform, as the last value of
the set. Use the format "'; charset=XXX'". If you use a transform, for
which you can specify 2 options and you want to append a character
set, enter "'first parameter','second parameter','charset=us-ascii'".
You can, however use the defaults for the parameters: "'','','charset
=us-ascii'". The default options can be configured using
:config:option:`$cfg['DefaultTransformations']`.
* 'Input transformation' is another drop-down menu that corresponds exactly
with the instructions above for "Browser display transformation" except
these these affect the data before insertion in to the database. These are
most commonly used to either provide a specialized editor (for example, using
the phpMyAdmin SQL editor interface) or selector (such as for uploading an image).
It's also possible to manipulate the data such as converting an IPv4 address to binary
or parsing it through a regular expression.
* Finally, 'Input transformation options' is the equivalent of the "Browser display
transformation options" section above and is where optional and required parameters are entered.
.. _transformationsfiles:
File structure
++++++++++++++
All specific transformations for mimetypes are defined through class
files in the directory :file:`libraries/classes/Plugins/Transformations/`. Each of
them extends a certain transformation abstract class declared in
:file:`libraries/classes/Plugins/Transformations/Abs`.
They are stored in files to ease customization and to allow easy adding of
new or custom transformations.
Because the user cannot enter their own mimetypes, it is kept certain that
the transformations will always work. It makes no sense to apply a
transformation to a mimetype the transform-function doesn't know to
handle.
There is a file called :file:`libraries/classes/Plugins/Transformations.php` that provides some
basic functions which can be included by any other transform function.
The file name convention is ``[Mimetype]_[Subtype]_[Transformation
Name].php``, while the abstract class that it extends has the
name ``[Transformation Name]TransformationsPlugin``. All of the
methods that have to be implemented by a transformations plug-in are:
#. getMIMEType() and getMIMESubtype() in the main class;
#. getName(), getInfo() and applyTransformation() in the abstract class
it extends.
The getMIMEType(), getMIMESubtype() and getName() methods return the
name of the MIME type, MIME Subtype and transformation accordingly.
getInfo() returns the transformation's description and possible
options it may receive and applyTransformation() is the method that
does the actual work of the transformation plug-in.
Please see the :file:`libraries/classes/Plugins/Transformations/TEMPLATE` and
:file:`libraries/classes/Plugins/Transformations/TEMPLATE\_ABSTRACT` files for adding
your own transformation plug-in. You can also generate a new
transformation plug-in (with or without the abstract transformation
class), by using
:file:`scripts/transformations_generator_plugin.sh` or
:file:`scripts/transformations_generator_main_class.sh`.
The applyTransformation() method always gets passed three variables:
#. **$buffer** - Contains the text inside of the column. This is the
text, you want to transform.
#. **$options** - Contains any user-passed options to a transform
function as an array.
#. **$meta** - Contains an object with information about your column. The
data is drawn from the output of the `mysql\_fetch\_field()
<https://www.php.net/mysql_fetch_field>`_ function. This means, all
object properties described on the `manual page
<https://www.php.net/mysql_fetch_field>`_ are available in this
variable and can be used to transform a column accordingly to
unsigned/zerofill/not\_null/... properties. The $meta->mimetype
variable contains the original :term:`Media type` of the column (i.e.
'text/plain', 'image/jpeg' etc.)

View file

@ -0,0 +1,69 @@
.. _2fa:
Two-factor authentication
=========================
.. versionadded:: 4.8.0
Since phpMyAdmin 4.8.0 you can configure two-factor authentication to be
used when logging in. To use this, you first need to configure the
:ref:`linked-tables`. Once this is done, every user can opt-in for the second
authentication factor in the :guilabel:`Settings`.
When running phpMyAdmin from the Git source repository, the dependencies must be installed
manually; the typical way of doing so is with the command:
.. code-block:: sh
composer require pragmarx/google2fa-qrcode bacon/bacon-qr-code
Or when using a hardware security key with FIDO U2F:
.. code-block:: sh
composer require code-lts/u2f-php-server
Authentication Application (2FA)
--------------------------------
Using an application for authentication is a quite common approach based on HOTP and
`TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm>`_.
It is based on transmitting a private key from phpMyAdmin to the authentication
application and the application is then able to generate one time codes based
on this key. The easiest way to enter the key in to the application from phpMyAdmin is
through scanning a QR code.
There are dozens of applications available for mobile phones to implement these
standards, the most widely used include:
* `FreeOTP for iOS, Android and Pebble <https://freeotp.github.io/>`_
* `Authy for iOS, Android, Chrome, OS X <https://authy.com/>`_
* `Google Authenticator for iOS <https://apps.apple.com/us/app/google-authenticator/id388497605>`_
* `Google Authenticator for Android <https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2>`_
* `LastPass Authenticator for iOS, Android, OS X, Windows <https://lastpass.com/auth/>`_
Hardware Security Key (FIDO U2F)
--------------------------------
Using hardware tokens is considered to be more secure than a software based
solution. phpMyAdmin supports `FIDO U2F <https://en.wikipedia.org/wiki/Universal_2nd_Factor>`_
tokens.
There are several manufacturers of these tokens, for example:
* `youbico FIDO U2F Security Key <https://www.yubico.com/fido-u2f/>`_
* `HyperFIDO <https://www.hypersecu.com/hyperfido>`_
* `Trezor Hardware Wallet <https://trezor.io/?offer_id=12&aff_id=1592&source=phpmyadmin>`_ can act as an `U2F token <https://wiki.trezor.io/User_manual:Two-factor_Authentication_with_U2F>`_
* `List of Two Factor Auth (2FA) Dongles <https://www.dongleauth.info/dongles/>`_
.. _simple2fa:
Simple two-factor authentication
--------------------------------
This authentication is included for testing and demonstration purposes only as
it really does not provide two-factor authentication, it just asks the user to confirm login by
clicking on the button.
It should not be used in the production and is disabled unless
:config:option:`$cfg['DBG']['simple2fa']` is set.

View file

@ -0,0 +1,16 @@
User Guide
==========
.. toctree::
:maxdepth: 2
settings
two_factor
transformations
bookmarks
privileges
relations
charts
import_export
themes
other

View file

@ -0,0 +1,51 @@
Distributing and packaging phpMyAdmin
=====================================
This document is intended to give pieces of advice to people who want to
redistribute phpMyAdmin inside other software packages such as Linux
distribution or some all in one package including web server and MySQL
server.
Generally, you can customize some basic aspects (paths to some files and
behavior) in :file:`libraries/vendor_config.php`.
For example, if you want setup script to generate a config file in var, change
``SETUP_CONFIG_FILE`` to :file:`/var/lib/phpmyadmin/config.inc.php` and you
will also probably want to skip directory writable check, so set
``SETUP_DIR_WRITABLE`` to false.
External libraries
------------------
phpMyAdmin includes several external libraries, you might want to
replace them with system ones if they are available, but please note
that you should test whether the version you provide is compatible with the
one we ship.
Currently known list of external libraries:
js/vendor
jQuery js framework libraries and various js libraries.
vendor/
The download kit includes various Composer packages as
dependencies.
Specific files LICENSES
-----------------------
phpMyAdmin distributed themes contain some content that is under licenses.
- The icons of the `Original` and `pmahomme` themes are from the `Silk Icons <http://www.famfamfam.com/lab/icons/silk/>`_.
- Some icons of the `Metro` theme are from the `Silk Icons <http://www.famfamfam.com/lab/icons/silk/>`_.
- `themes/*/img/b_rename.svg` Is a `Icons8 <https://thenounproject.com/Icons8/>`_, icon from the `Android L Icon Pack Collection <https://thenounproject.com/Icons8/collection/android-l-icon-pack/>`_. The icon `rename <https://thenounproject.com/term/rename/61456/>`_.
- `themes/metro/img/user.svg` Is a IcoMoon the `user <https://github.com/Keyamoon/IcoMoon-Free/blob/master/SVG/114-user.svg>`_
CC BY 4.0 or GPL
Licenses for vendors
--------------------
- Silk Icons are under the `CC BY 2.5 or CC BY 3.0 <http://www.famfamfam.com/lab/icons/silk/>`_ licenses.
- `rename` from `Icons8` is under the `"public domain" <https://creativecommons.org/publicdomain/zero/1.0/>`_ (CC0 1.0) license.
- IcoMoon Free is under `"CC BY 4.0 or GPL" <https://github.com/Keyamoon/IcoMoon-Free/blob/master/License.txt>`_.