Software & Apps Linux How to Install phpMyAdmin On Ubuntu Server For MySQL Administration Make your MySQL database administration much easier with the help of GUI by Jack Wallen Writer Jack Wallen is a former Lifewire writer, an award-winning writer for TechRepublic and Linux.com, and the voice of The Android Expert. our editorial process LinkedIn Jack Wallen Updated on February 14, 2020 Linux Switching from Windows Tweet Share Email MySQL is a powerful database program that helps to serve as the foundation of so many applications and services. In fact, many of the websites you visit (such as Facebook, GitHub, iStock, US Navy, YouTube, Spotify, and more) are powered by MySQL. For many database administrators, working from within the command-line interface is a no-brainer. But for some, having a user-friendly GUI can mean actually working with a level of efficiency the command prompt cannot offer. One of the best tools for this task is phpMyAdmin. The phpMyAdmin tool is an incredibly easy to use interface that can be installed on off-the-shelf hardware with a single command. The only caveat to the installation is that it has changed from previous iterations and the MySQL permissions can be finicky. Installation Before we run the installation commands, it’s always smart to update and upgrade Ubuntu Server. Because the kernel might be upgraded, it’s best to run the update/upgrade process at a time when a reboot is possible. To update and upgrade Ubuntu Server, login and issue the following commands: sudo apt-get updatesudo a When the above commands complete, reboot the server (if needed) and install the Apache and MySQL servers (if they aren’t already installed) with the command: sudo apt-get instal When that command completes, configure MySQL with the command: sudo mysql_se Upon issuing the above command, you will be prompted to create a password for the MySQL admin user, as well as: Remove anonymous users y/nDisallow root login remotely y/nRemove test database and access to it y/nReload privilege tables now y/n Answer yes to all of the above questions. Next, install phpMyAdmin with the command: sudo apt-get install phpmyadmin php-mbstri During the installation, you’ll be asked to select which web server will be used to run phpMyAdmin. Make sure to select apache2 from the options. To do this, follow these steps: Tap the spacebar on your keyboard to select apache2. Press the Tab key on your keyboard until Ok is selected and use the Enter key to continue on. Next, you will be prompted to Configure the database for phpmyadmin. Yes should already be selected, so use Enter on your keyboard to continue. Next, you’ll be prompted to create a password for the phpmyadmin user. Make this a unique and strong password. Type this new password, tab down to Ok, use the Enter key on your keyboard to continue, and then (when prompted) verify the newly created password. This completes the first stage of the installation. Configuring User Privileges In prior iterations, you could now point your browser to http://SERVER_IP/phpmyadmin (Where SERVER_IP is the IP address of the hosting server) and log in with the MySQL admin user credentials. That is no longer the case. Instead, you must give the phpmyadmin user the necessary privileges to manage the databases. To do this, go back to the terminal window on your server and open the MySQL database prompt with the following command: At the MySQL prompt, issue the following commands: GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' IDENTIFIED BY ‘password’;FLUSH PRIV Where password is the password you created for the phpmyadmin user during installation. Creating a New User If you’d rather create a new user (one that will also be able to manage databases from within phpMyAdmin), issue the following commands: sudo mysqlCREATE USER username IDENTIFIED BY 'password';GRANT ALL PRIVILEGES ON *.* TO ‘username’@'localhost' IDENTIFIED BY ‘password’;FLUSH PRIV Where username is the username to be created and password is a unique and strong password for the user. Logging Into phpMyAdmin Now it’s time to point your browser to http://SERVER_IP/phpmyadmin (Where SERVER_IP is the IP address of your server). You will be prompted for a username and password. Here you can either use phpmyadmin as the user and the password you created for the phpmyadmin user (during installation) or the new user/password you created from the MySQL prompt. If you select the Databases tab, you should see that the user you logged in with has all the necessary permissions to start working with the MySQL databases, via the phpMyAdmin interface. Create and manage databases, tables, and data from within this user-friendly web-based MySQL GUI.