mariadb -u root -p phpmyadmin < \/usr\/share\/phpmyadmin\/sql\/create_tables.sql<\/code><\/pre>\n\n\n\nDefine phpMyAdmin Access Credentials<\/h3>\n\n\n\n Rename the sample phpMyAdmin configuration file;<\/p>\n\n\n\n
sudo cp \/usr\/share\/phpmyadmin\/config{.sample,}.inc.php<\/pre>\n\n\n\nEdit the config,\u00a0\/usr\/share\/phpmyadmin\/config.inc.php<\/code><\/strong>, and uncomment the lines below and update them with your database connection username\/password;<\/p>\n\n\n\nsudo vim \/usr\/share\/phpmyadmin\/config.inc.php<\/code><\/pre>\n\n\n\n\/\/ $cfg['Servers'][$i]['controluser'] = 'pma';\n\/\/ $cfg['Servers'][$i]['controlpass'] = 'pmapass';<\/code><\/pre>\n\n\n\nUpdate them with your database logins created above.<\/p>\n\n\n\n
$cfg['Servers'][$i]['controluser'] = 'phpmyadmin';\n$cfg['Servers'][$i]['controlpass'] = 'ChangeME';<\/code><\/pre>\n\n\n\nSave and exit the file.<\/p>\n\n\n\n
Update Apache VirtualHost for phpMyAdmin<\/h3>\n\n\n\n The installer automatically creates and enable Apache virtual host configuration file for phpMyAdmin as shown below;<\/p>\n\n\n\n
cat \/etc\/apache2\/conf-available\/phpmyadmin.conf<\/pre>\n\n\n\n\n# phpMyAdmin default Apache configuration\n\nAlias \/phpmyadmin \/usr\/share\/phpmyadmin\n\n<Directory \/usr\/share\/phpmyadmin>\n Options SymLinksIfOwnerMatch\n DirectoryIndex index.php\n\n # limit libapache2-mod-php to files and directories necessary by pma\n <IfModule mod_php7.c>\n php_admin_value upload_tmp_dir \/var\/lib\/phpmyadmin\/tmp\n php_admin_value open_basedir \/usr\/share\/phpmyadmin\/:\/usr\/share\/doc\/phpmyadmin\/:\/etc\/phpmyadmin\/:\/var\/lib\/phpmyadmin\/:\/usr\/share\/php\/:\/usr\/share\/javascript\/\n <\/IfModule>\n\n # PHP 8+\n <IfModule mod_php.c>\n php_admin_value upload_tmp_dir \/var\/lib\/phpmyadmin\/tmp\n php_admin_value open_basedir \/usr\/share\/phpmyadmin\/:\/usr\/share\/doc\/phpmyadmin\/:\/etc\/phpmyadmin\/:\/var\/lib\/phpmyadmin\/:\/usr\/share\/php\/:\/usr\/share\/javascript\/\n <\/IfModule>\n\n<\/Directory>\n\n# Disallow web access to directories that don't need it\n<Directory \/usr\/share\/phpmyadmin\/templates>\n Require all denied\n<\/Directory>\n<Directory \/usr\/share\/phpmyadmin\/libraries>\n Require all denied\n<\/Directory>\n<\/code><\/pre>\n\n\n\nYou can update it if need be!<\/p>\n\n\n\n
phpMyAdmin Database Details<\/h3>\n\n\n\n If you used phpMyAdmin dbconfig-common tool to create the database, you should be able to get these details on the MariaDB database server.<\/p>\n\n\n\n
Thus, login and check;<\/p>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\nshow databases;<\/code><\/pre>\n\n\n\n\n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n| mysql |\n| performance_schema |\n| phpmyadmin |\n| sys |\n+--------------------+\n5 rows in set (0.000 sec)\n<\/code><\/pre>\n\n\n\nCheck tables;<\/p>\n\n\n\n
use phpmyadmin;<\/code><\/pre>\n\n\n\nshow tables;<\/code><\/pre>\n\n\n\n\n+------------------------+\n| Tables_in_phpmyadmin |\n+------------------------+\n| pma__bookmark |\n| pma__central_columns |\n| pma__column_info |\n| pma__designer_settings |\n| pma__export_templates |\n| pma__favorite |\n| pma__history |\n| pma__navigationhiding |\n| pma__pdf_pages |\n| pma__recent |\n| pma__relation |\n| pma__savedsearches |\n| pma__table_coords |\n| pma__table_info |\n| pma__table_uiprefs |\n| pma__tracking |\n| pma__userconfig |\n| pma__usergroups |\n| pma__users |\n+------------------------+\n19 rows in set (0.001 sec)\n<\/code><\/pre>\n\n\n\nYou can get the credentials in the file \/etc\/phpmyadmin\/config-db.php<\/code><\/strong>, if you did define create them during the installation. Otherwise, edit the file and update the phpMyAdmin access details.<\/p>\n\n\n\nsudo vim \/etc\/phpmyadmin\/config-db.php<\/code><\/pre>\n\n\n\n\n<?php\n##\n## database access settings in php format\n## automatically generated from \/etc\/dbconfig-common\/phpmyadmin.conf\n## by \/usr\/sbin\/dbconfig-generate-include\n##\n## by default this file is managed via ucf, so you shouldn't have to\n## worry about manual changes being silently discarded. *however*,\n## you'll probably also want to edit the configuration file mentioned\n## above too.\n##\n$dbuser='phpmyadmin';\n$dbpass='ChangeME';<\/strong>\n$basepath='';\n$dbname='phpmyadmin';\n$dbserver='localhost';\n$dbport='3306';\n$dbtype='mysql';\n<\/code><\/pre>\n\n\n\nThe installer also creates a phpMyAdmin configuration with the content below;<\/p>\n\n\n\n
sudo cat \/etc\/phpmyadmin\/config.inc.php<\/code><\/pre>\n\n\n\n\n<?php\n\/**\n * Debian local configuration file\n *\n * This file overrides the settings made by phpMyAdmin interactive setup\n * utility.\n *\n * For example configuration see\n * \/usr\/share\/doc\/phpmyadmin\/examples\/config.sample.inc.php\n * or\n * \/usr\/share\/doc\/phpmyadmin\/examples\/config.manyhosts.inc.php\n *\n * NOTE: do not add security sensitive data to this file (like passwords)\n * unless you really know what you're doing. If you do, any user that can\n * run PHP or CGI on your webserver will be able to read them. If you still\n * want to do this, make sure to properly secure the access to this file\n * (also on the filesystem level).\n *\/\n\nif (!function_exists('check_file_access')) {\n function check_file_access(string $path): bool\n {\n if (is_readable($path)) {\n return true;\n }\n\n if (! file_exists($path)) {\n return false;\n }\n\n error_log(\n 'phpmyadmin: Failed to load ' . $path\n . ' Check group www-data has read access and open_basedir restrictions.'\n );\n return false;\n }\n}\n\n\/\/ Load secret generated on postinst\nif (check_file_access('\/var\/lib\/phpmyadmin\/blowfish_secret.inc.php')) {\n require('\/var\/lib\/phpmyadmin\/blowfish_secret.inc.php');\n}\n\n\/**\n * Server(s) configuration\n *\/\n$i = 0;\n\/\/ The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].\n\/\/ You can disable a server config entry by setting host to ''.\n$i++;\n\n\/**\n * Read configuration from dbconfig-common\n * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin\n *\/\nif (check_file_access('\/etc\/phpmyadmin\/config-db.php')) {\n require('\/etc\/phpmyadmin\/config-db.php');\n}\n\n\/* Configure according to dbconfig-common if enabled *\/\nif (!empty($dbname)) {\n \/* Authentication type *\/\n $cfg['Servers'][$i]['auth_type'] = 'cookie';\n \/* Server parameters *\/\n if (empty($dbserver)) $dbserver = 'localhost';\n $cfg['Servers'][$i]['host'] = $dbserver;\n\n if (!empty($dbport) || $dbserver != 'localhost') {\n $cfg['Servers'][$i]['connect_type'] = 'tcp';\n $cfg['Servers'][$i]['port'] = $dbport;\n }\n \/\/$cfg['Servers'][$i]['compress'] = false;\n \/* Optional: User for advanced features *\/\n $cfg['Servers'][$i]['controluser'] = $dbuser;\n $cfg['Servers'][$i]['controlpass'] = $dbpass;\n \/* Optional: Advanced phpMyAdmin features *\/\n $cfg['Servers'][$i]['pmadb'] = $dbname;\n $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';\n $cfg['Servers'][$i]['relation'] = 'pma__relation';\n $cfg['Servers'][$i]['table_info'] = 'pma__table_info';\n $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';\n $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';\n $cfg['Servers'][$i]['column_info'] = 'pma__column_info';\n $cfg['Servers'][$i]['history'] = 'pma__history';\n $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';\n $cfg['Servers'][$i]['tracking'] = 'pma__tracking';\n $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';\n $cfg['Servers'][$i]['recent'] = 'pma__recent';\n $cfg['Servers'][$i]['favorite'] = 'pma__favorite';\n $cfg['Servers'][$i]['users'] = 'pma__users';\n $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';\n $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';\n $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';\n $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';\n $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';\n $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';\n\n \/* Uncomment the following to enable logging in to passwordless accounts,\n * after taking note of the associated security risks. *\/\n \/\/ $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;\n\n \/* Advance to next server for rest of config *\/\n $i++;\n}\n\n\/* Authentication type *\/\n\/\/$cfg['Servers'][$i]['auth_type'] = 'cookie';\n\/* Server parameters *\/\n\/\/$cfg['Servers'][$i]['host'] = 'localhost';\n\/\/$cfg['Servers'][$i]['connect_type'] = 'tcp';\n\/\/$cfg['Servers'][$i]['compress'] = false;\n\/* Uncomment the following to enable logging in to passwordless accounts,\n * after taking note of the associated security risks. *\/\n\/\/ $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;\n\n\/**\n * phpMyAdmin configuration storage settings.\n *\/\n\n\/* User used to manipulate with storage *\/\n\/\/ $cfg['Servers'][$i]['controlhost'] = '';\n\/\/ $cfg['Servers'][$i]['controlport'] = '';\n\/\/ $cfg['Servers'][$i]['controluser'] = 'pma';\n\/\/ $cfg['Servers'][$i]['controlpass'] = 'pmapass';\n\n\/* Storage database and tables *\/\n\/\/ $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';\n\/\/ $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';\n\/\/ $cfg['Servers'][$i]['relation'] = 'pma__relation';\n\/\/ $cfg['Servers'][$i]['table_info'] = 'pma__table_info';\n\/\/ $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';\n\/\/ $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';\n\/\/ $cfg['Servers'][$i]['column_info'] = 'pma__column_info';\n\/\/ $cfg['Servers'][$i]['history'] = 'pma__history';\n\/\/ $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';\n\/\/ $cfg['Servers'][$i]['tracking'] = 'pma__tracking';\n\/\/ $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';\n\/\/ $cfg['Servers'][$i]['recent'] = 'pma__recent';\n\/\/ $cfg['Servers'][$i]['favorite'] = 'pma__favorite';\n\/\/ $cfg['Servers'][$i]['users'] = 'pma__users';\n\/\/ $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';\n\/\/ $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';\n\/\/ $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';\n\/\/ $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';\n\/\/ $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';\n\/\/ $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';\n\n\/*\n * End of servers configuration\n *\/\n\n\/*\n * Directories for saving\/loading files from server\n *\/\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n\/* Support additional configurations *\/\nforeach (glob('\/etc\/phpmyadmin\/conf.d\/*.php') as $filename)\n{\n include($filename);\n}\n<\/code><\/pre>\n\n\n\nRestart Apache HTTP Service<\/h3>\n\n\n\n Confirm that Apache configurations are syntactically correct;<\/p>\n\n\n\n
sudo apachectl -t<\/code><\/pre>\n\n\n\nEnsure the output is, Syntax OK<\/strong>.<\/p>\n\n\n\nThe restart;<\/p>\n\n\n\n
sudo systemctl restart apache2<\/code><\/pre>\n\n\n\nOpen HTTP\/HTTPS port on Firewall<\/h3>\n\n\n\n Allow Apache on UFW for external access.<\/p>\n\n\n\n
ufw allow \"WWW Full\"<\/pre>\n\n\n\nYou can use Iptables or firewalld if you want.<\/p>\n\n\n\n
Accessing phpMyAdmin on Ubuntu 24.04<\/h3>\n\n\n\n You can now access phpMyAdmin from the browser using the address, http:\/\/server-host-name_or_IP\/phpmyadmin<\/strong><\/code>.<\/p>\n\n\n\nLogin using your database root user credentials or the user with access to only specific databases.<\/p>\n\n\n\n
To use root use for login, you need to enable MariaDB\/MySQL password based authentication;<\/p>\n\n\n\n
Enable MariaDB password Authentication<\/a><\/p>\n\n\n\n <\/figure>\n\n\n\nUpon successful login, you get to phpMyAdmin dashboard.<\/p>\n\n\n\n <\/figure>\n\n\n\nYou have successfully installed and setup phpMyAdmin on Ubuntu 24.04. You can now be able to administer your MySQL or MariaDB from web.<\/p>\n","protected":false},"excerpt":{"rendered":"
In this guide, we are going to learn how to install phpMyAdmin on Ubuntu 24.04. phpMyAdmin is a free and opensource application written in PHP<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-22522","post","type-post","status-publish","format-standard","hentry","category-howtos","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22522"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=22522"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22522\/revisions"}],"predecessor-version":[{"id":22538,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22522\/revisions\/22538"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=22522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=22522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=22522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}