How to install PhpMyAdmin

Never knew how to install phpmyadmin on a Ubuntu server, but now it's pretty easy. just go to https://www.phpmyadmin.net/downloads/ then download which version you want.

// example
// go to the folder you want to put it
wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-english.tar.gz
tar -xf phpMyAdmin-5.2.1-english.tar.gz

If you want to put it in a subdomain

server {
    listen       80;
    server_name domain.com;

    location / {
        root /var/www/html/phpMyAdmin-5.2.1-english;
        index  index.php index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        root /var/www/html/phpMyAdmin-5.2.1-english;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Don't forget to rename this

cp config.sample.inc.php config.inc.php

If it's in a different hosts, the change the host

/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

Subscribe to You Live What You Learn

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe