Debian 10 Buster, Installing LAMP and PHPMyAdmin

Writing this guide to help anyone who would like to install LAMP Debian 10 with MySQL (not maria DB). I found great help on the internet and I would be using articles.

I tried to use Tasksel for some reason it just did not work. It would have been wonderful to install everything from a single command.

Installing Apache and PHP

I used the following article to install Apache and PHP but since the used Maria DB I skipped that part

https://www.linuxbabe.com/debian/install-lamp-stack-debian-10-buster

Installing MySQL.

https://www.digitalocean.com/community/tutorials/how-to-install-the-latest-mysql-on-debian-10

Installing PHPMyAdmin

I used the following guide but since it used MariaDB I altered the command to suite MySQL

https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-from-source-debian-10

The following are the commands which were altered.

sudo mariadb < /usr/share/phpmyadmin/sql/create_tables.sql

was altered to the following

sudo mysql -p < /usr/share/phpmyadmin/sql/create_tables.sql

This would prompt for the password which you can enter.

From there on you can use the following commands.

sudo mysql -p
alter user  'pma'@'localhost' identified with mysql_native_password by 'password'
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost'

Please remember to replace the password with your own password.

I also updated the authentication method for the root user because it was throwing an error.

image

To fix this I used the following MySQL Command

alter user  'root'@'localhost' identified with mysql_native_password by 'password'

Please remember to replace ‘password’ with your own password.

You can follow the rest of the instructions just as they have been described in Step 3 of the following link.

https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-from-source-debian-10

I am thankful for all the authors who have written all the above articles it was a great help.