phpMyadmin is open-source web application that provides graphical interface for MySql or MariaDB database. Many users don't use direct MySQL command prompt and only use graphical interface. So with phpMyAdmin, you can run, get all MySQL query in graphical interface.
You need to have non-root user account logged in with sudo privileges to set up on your server. You also have LAMP installed in your server or else Install LAMP.
This tutorial will show you how to install phpMyAdmin in Ubuntu step by step.
Open the terminal either by using the CTRL+ALT+T
keyboard shortcut or search Terminal from menu. Now run following command in terminal.
sudo apt-get update
After update package repository, run bellow command, it will start installing phpMyAdmin.
sudo apt install phpmyadmin php-mbstring php-gettext
During installation, it will ask for configuration as bellow images. Press TAB
button for navigation, and hit SPACE
button on apache2, it will select apache2 as web server for phpMyAdmin. Again press TAB
and go to <ok>
button and press ENTER
.
After that new screen will display as bellow picture. It will ask whether to use dbconfig-common
to set up the database. Press ENTER
on <Yes>
option.
Now it will ask to enter MySQL root password and confirmation. Enter password and It will create phpmyadmin database with required configuration and privileges.
First edit bellow file by running command with nano editor.
sudo nano /etc/apache2/apache2.conf
Then add the bellow lines at the bottom of the file:
Save the file by pressing CTRL+X
and SHIFT+Y
. Restart the apache2 server.
sudo service apache2 restart
Now go to your-website.com/phpmyadmin
or ip-address/phpmyadmin
url or in case local server, go to localhost/phpmyadmin and you can see bellow screen:
Enter root user and password and hit enter, you will see bellow screen:
phpMyAdmin lets you access your website database, so it is important to provide more security to access phpMyAdmin. Follow these steps to secure phpMyAdmin. Edit bellow file by running command with nano editor.
sudo nano /etc/apache2/conf-available/phpmyadmin.conf
Find the bellow lines in <Directory>
tags and add the AllowOverride ALL
directive in that.
Now create new .htaccess
File with command.
sudo nano /usr/share/phpmyadmin/.htaccess
Put the bellow lines.
Save the file by pressing CTRL+X
and SHIFT+Y
. Restart the apache2 server.
sudo systemctl restart apache2
Now create new user
sudo htpasswd -c /etc/phpmyadmin/.htpasswd username
It will ask enter password and confirm password. If you want to create new user, run the command without -c
flag like this
sudo htpasswd /etc/phpmyadmin/.htpasswd newusername
Now whenever you try to access your phpMyAdmin, new it will prompt for username and password:
So now you have successfully installed phpMyAdmin on your Ubuntu server. Now you can perform all SQL query with graphical interface.
I hope it will help you.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to detect click inside iframe using JavaScript
Use the jQuery contents() method If y...Single and Multiple Files Upload in VueJs
In this tutorial, we are going to learn...PHP 7 - Upload Files & Images with Example Tutorials
This is a step by step PHP 7 file upload...How to make HTTP GET and POST Request in ReactJs using Axios
In this React Axios tutorial, we ar...Laravel 8 Send Mail using Queue Tutorial
In this turorial we wil see how we can s...