phpMyAdmin is available in the default repositories of Ubuntu operating system. Once LAMP stack is installed and ready, install phpMyAdmin as shown below:
sudo apt-get install phpmyadmin
sudo apt-get install phpmyadmin
During installing, you’ll be asked to choose the web server that should be automatically configured to run phpMyAdmin. In our case, it is Apache webserver.
Choose apache2 and click OK.
Select Yes and hit ENTER to configure database for phpmyadmin with dbconfig-common.
Enter a password for phpmyadmin to register with the database server. If left blank, a random password will be generated.
Re-enter the password to confirm:
Oops! You might be encountered with the following error message:
To fix this issue, click OK and abort the phpMyAdmin installation.
Log in to MariaDB or MySQL prompt with root user using command:
Create a new database and database user for phpMyAdmin and grant full permission to the phpmyadmin user.
For the purpose of this tutorial, I am going to create a database called “phpmyadmindb”, and database user “phpmyadminuser” with password “ubuntu”. Please use a strong password which is very hard to guess in the production environment.
Then, edit phpmyadmin/config-db.php file:
Replace the database name, database user and its password with the values that you have created earlier.
Save and close the file.
Next, you must install the following php modules. Otherwise, you will get an error message that says:
The mbstring extension is missing. Please check your PHP configuration.
To install php modules, run:
Then, edit Apache webserver config file:
Add the following line at the end:
Save and close the file. Restart apache service to take effect the changes.
Access phpMyAdmin dashboard
Open up the web browser and navigate to http://IP-Address/phpmyadmin.
You should see the following screen. Enter the MariaDB/MySQL ‘root’ user name and its password.
Congrats! This is how the phpMyAdmin dashboard looks like.
From here, you can create, delete, rename, and manage the databases easily.
Source : https://www.ostechnix.com/install-phpmyadmin-with-lamp-stack-on-ubuntu-16-04/
No comments:
Post a Comment