To setup and install Apache Web Server + MySQL with the LAMP Stack on any of the cloud platforms, the recommended way is to use the available image on the cloud marketplace. It comes pre-configured with the full LAMP Stack – Apache Web Server, MySQL Server, PHP, PHPMyadmin and Let’s Encrypt. Check out the links below to deploy to your preferred cloud provider.
Apache Web Server + MySQL Server on Linux Cloud (LAMP Stack)
Once logged in via your ssh terminal, the first thing to do is to set a new password for the MySQL root user account by running the following commands. Replace the text ‘your_pass_here‘ with your new password.
mysql --user=root --password
Enter password: mysql1234
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_pass_here';
FLUSH PRIVILEGES;
If you receive an error related to your SQL syntax, depending on the version of MariaDB installed, try the following command to change your mysql root user password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_pass';
To login to phpmyadmin, browse to the following URL on your web browser (use http) :
http://youserverip/phpmyadmin
You can login using your root account or you can create a new user account by running the following commands from your ssh terminal:
Create new Root User
sudo mysql
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
Change Root User Password
If you want to change the password of your root user, simply run the following command:
Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.