Size: 3031
Comment:
|
Size: 2970
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from PhpMyAdminSetup = phpMyAdmin = |
= PhpMyAdmin = |
Line 4: | Line 3: |
A web interface for [[MariaDBSetup|MySQL/MariaDB]]. | '''phpMyAdmin''' is a web interface for [[MariaDB|MySQL and/or MariaDB]]. |
Line 42: | Line 41: |
[[NGINXSetup|NGINX]] can be configured to serve phpMyAdmin easily... as long as you've already configured [[FastCGISetup|FastCGI]]. | [[NGINX]] can be configured to serve phpMyAdmin by [[NGINX/FastCGIConfiguration|FastCGI]]. |
PhpMyAdmin
phpMyAdmin is a web interface for MySQL and/or MariaDB.
Installation
Fetch the latest version of the software package.
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-english.zip
Create an installation directory that can be owned by the web server's user (typically www-data).
mkdir /var/www/phpmyadmin unzip phpMyAdmin-5.0.1-english.zip cp phpMyAdmin-5.0.1-english/* /var/www/phpmyadmin/ -r chown www-data:www-data /var/www/phpmyadmin -R chmod 775 /var/www/phpmyadmin -R
Update
Move the deployment to /var/www/phpmyadmin-temp and repeat the installation process for the new version. Copy the config.inc.php configuration file from the old to the new deployment. Test and, if successful, remove the old deployment.
Configuration
Web Server
NGINX can be configured to serve phpMyAdmin by FastCGI.
server { listen 80; server_name pma.my-domain.tld; root /var/www/phpmyadmin; index index.php; location / { try_files $uri $uri/ =404; } error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.*)$; try_files $uri $document_root$fastcgi_script_name =404; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; } }
Back-end
On first installation, the phpMyAdmin back-end tables must be configured.
mysql -u root -p < /var/www/phpmyadmin/sql/create_tables.sql
The phpMyAdmin user must be given permissions to many structural tables.
The recommended setup is:
GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass'; GRANT SELECT ( Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv ) ON mysql.user TO 'pma'@'localhost'; GRANT SELECT ON mysql.db TO 'pma'@'localhost'; GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO 'pma'@'localhost';
Some tutorials will also advise granting permissions to the mysql.host table... which as of MariaDB version 10.1 no longer exists.
The nuclear option is always valid:
GRANT USAGE ON *.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';