Installing phpMyAdmin on Ubuntu 17.04

phpMyAdmin is a great web-based database management tool. It’s a free PHP application that makes managing MySQL or MariaDB databases easy even for new users and students. Instead of running database queries from the command line terminal, users can use phpMyAdmin via a web browser to manage the database.

For new students and users, phpMyAdmin provides a great starting point to managing databases. With this tool, users can quickly and easily create and delete databases, import and export, and do almost all tasks one can do via the command line terminal.

This brief tutorial is going to show students how to easily install phpMyAdmin on Ubuntu 17.04

Step 1: Update Ubuntu

To get started, logon to the Ubuntu server as a root user. Then run the commands below to update the server. It’s always recommended to update Ubuntu before installing packages.

sudo apt-get update && sudo apt-get dist-upgrade

Step 2: Install PHP, Apache2, MySQL

phpMyAdmin is a PHP based tool. It requires PHP, a web server as well as a database server.. usually MySQL or MariaDB and Apache2. To the commands below to install PHP and MySQL and Apache2.

sudo apt-get install apache2 php mysql-server

During the installation, you will be prompted to create and confirm a new password for MySQL root user. This is the account that you’ll use to manage the database server.

┌────────────────────┤ Configuring mysql-server-5.7 ├─────────────────────┐
│ While not mandatory, it is highly recommended that you set a password
│ for the MySQL administrative "root" user.
│ If this field is left blank, the password will not be changed.
│ New password for the MySQL "root" user:


Continue below to installing phpMyAdmin

Step 3: Install phpMyAdmin

Now that the required packages are installed, go and install phpMyAdmin. To do that, run the commands below

sudo apt-get install phpmyadmin

During the installation of phpmyadmin, you’ll be prompted to select a webserver to use with the tool. Please choose apache2 and continue.

┌────────────────────────┤ Configuring phpmyadmin ├─────────────────────────┐
│ Please choose the web server that should be automatically configured to
│ run phpMyAdmin.
│ Web server to reconfigure automatically:
│ [*] apache2
│ [ ] lighttpd

When prompted with the screen below during the installation, choose Yes.

┌────────────────────────┤ Configuring phpmyadmin ├─────────────────────────┐
│ The phpmyadmin package must have a database installed and configured
│ before it can be used. This can be optionally handled with
│ dbconfig-common.
│ If you are an advanced database administrator and know that you want to
│ perform this configuration manually, or if your database has already
│ been installed and configured, you should refuse this option. Details on
│ what needs to be done should most likely be provided in
│ /usr/share/doc/phpmyadmin.
│ Otherwise, you should probably choose this option.
│ Configure database for phpmyadmin with dbconfig-common?
│                                 <Yes> <No> │


You’ll be prompted to create and confirm phpMyAdmin root user password. Please do.

When you’re done, you should be able to access the tool by browsing to the server hostname or IP address followed by phpmyadmin. Example below.


You should then see the login page for phpMyAdmin.

phpmyadmin logon page on ubuntu


This post shows users an easy way to manage MySQL databases with phpMyAdmin. It’s a great way for new users and students to manage MySQL databases without learning the complex queries that are associated with database management.

So, if you need complete basic MySQL tasks, try phpMyAdmin.


You may also like this post:


  1. After installation, I opened http://localhost and I receive

    Error establishing a database connection

    and after installing phpmyadmin:

    404 Not Found

    Can someone please share their knowledge? This is the first time I had this kind of error.

    1. This also should just work after installing.. confirm the root password for mysql. If you can’t find a solution, repeat the database step to create another user and password.. then try again.

  2. how do I enable so I can use the database from other IP?

  3. Hello, after installing this where should I put the src files for my website to test it ?

  4. Hi,

    I installed lamp from the server setup routine, but phpmyadmin doesn’t seem to work. I cannot find it in /usr/share so I think it is not installed yet.

    However the command sudo apt-get install phpmyadmin returns an error: cannot find phpmyadmin

    I already did apt-get update and apt-get upgrade.

  5. [email protected]:~$ sudo apt-get install phpmyadmin
    [sudo] password for adi:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    phpmyadmin is already the newest version (4:4.6.6-5).
    0 upgraded, 0 newly installed, 0 to remove and 125 not upgraded.
    3 not fully installed or removed.
    Need to get 0 B/253 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up mysql-server-5.7 (5.7.21-1) …
    update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn’t exist
    dpkg: error processing package mysql-server-5.7 (–configure):
    installed mysql-server-5.7 package post-installation script subprocess returned error exit status 2
    dpkg: dependency problems prevent configuration of mysql-server:
    mysql-server depends on mysql-server-5.7; however:
    Package mysql-server-5.7 is not configured yet.

    dpkg: error processing package mysql-server (–configure):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Please help

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.