How to Setup MySQL Server + phpMyadmin on Linux in Azure/AWS/GCP

Setup and install the LAMP stack on any of the cloud platforms that includes MySQL Server, Apache Web Server, PHP, PHPMyadmin running on either Ubuntu or CentOS server using the publicly available image on the following cloud marketplaces below:

Getting Started

 

Once your MySQL server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, the following section explains how to start using MySQL (Scrowll down to the OS/Cloud platform you’re using). 

Configure MySQL on Ubuntu Server on Azure / GCP

 

Once logged in via your SSH terminal, the first step is to get the MySQL configuration ready.

 

Run the following command in order to start the MySQL configuration:

 

sudo mysql_secure_installation

 

Follow the onscreen prompts. You should reply with y (yes) to the rest of the prompts, and configure a root password when prompted to do so. This setup only takes a moment to complete.

mysql_secure_installation

Next, run the following commands, to set a new password for the root account:


sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_pass_here';

FLUSH PRIVILEGES;

Using  MySQL on CentOS Server on Azure / GCP

 

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;

Using MySQL on Ubuntu / CentOS Server on AWS

 

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;

mysql-centos

Using phpMyadmin to manage MySQL databases on Azure/AWS/GCP

To login to phpmyadmin, browse to the following URL on your web browser:

youserverip/phpmyadmin

phpmyadmin-login

You can login using your root account or you can create a new user account by running the following commands from your ssh terminal:

sudo mysql

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password';

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
Mysql-create-new-user

Support / Documentation

 

If you experience any issues on getting this MySQL server setup on any of the cloud platforms, please contact us and we will assist

 

For documentation, please refer to the following links:

 

Using MySQL:

https://dev.mysql.com/doc/mysql-getting-started/en/

 

Using phpMyadmin:

https://docs.phpmyadmin.net/en/latest/

 

Using Apache:

http://httpd.apache.org/docs/

MySQL Firewall Ports

 

Default MySQL port is: TCP 3306

Phpmyadmin port is: TCP 80

 

The links below explain how to modify / create firewall rules depending on which cloud platform you are using.

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Andrew Fitzgerald

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

0 0 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x