Home / Technology / IT / Linux / How to Install LAMP Server on Linux Mint 19 Cinnamon With few Commands

How to Install LAMP Server on Linux Mint 19 Cinnamon With few Commands

How to Install LAMP Server on Linux Mint 19 Cinnamon With few Commands :

Step 1: Update Linux

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

Reboot

sudo reboot

 

Step 2: Install the LAMP Server

sudo apt-get install lamp-server^ -y

Step. 3: Setup MySQL

Just enter a password for the root account twice when you asked.

Step 4: Test Apache

http://localhost

Step 5: Test PHP

sudo nano /var/www/html/info.php

Add the below line

<?php phpinfo(); ?>

Then CTRL+X then y and Enter

In your browser paste this line:

http://localhost/info.php

Note: Different versions of Linux store files in different folders by default. If the PHP test throws a browser error, you probably need to investigate and find out exactly where the test file is stored.

Install PHPMyAdmin

sudo apt-get install phpmyadmin -y

Note: You cannot login to phpmyadmin using root any more, So do as below to login with same privileges but with another user.

  • Login to mysql
mysql -u root
  • Grant privileges to a new user execute below command in mysql interface: “replace new-user with the name you need”

CREATE USER 'new-user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON
*.* TO 'new-user'@'localhost';
FLUSH PRIVILEGES
;

Now exit mysql and restart mysql

exit
service mysql restart

Test in broswer:

http://localhost/phpmyadmin

About Kalaweeza

Check Also

How to use root account to manage mysql databases

After installing mysql, you need to create an account to manage your databases as descried …

2 comments

  1. > Step. 3: Setup MySQL
    > Just enter a password for the root account twice when you [are] asked.

    Unfortunately, we are not asked for a password. I struggle hard in order to find, create, modify or reset that root password. It is impossible because is not needed. You just have to log in mysql as the superuser with the command > sudo mysql < yes, that's it. "sudo mysql".

    No need also to create a new user to launch phpmyadmin. In fact, this time, if you choose the automated configuration when prompted for a phpmyadmin database, you will next be asked for a password for the default user "phpmyadmin".

  2. Login to mysql should be :

    sudo mysql -u root

    worked fine with me and after that the rest too

Leave a Reply

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

Powered by keepvid themefull earn money