GOwithWeb

Get 50% Discount Offer 26 Days

GOwithWeb

Contact Info

1st St, Thiruvalluvar Puram, Choolaimedu, Chennai 600094

+90 9014179714

[email protected]

Get Started
How To Install MySQL on Ubuntu 22.04

How To Install MySQL on Ubuntu 22.04

Step 1: Update Your System

Ensure your system is updated before installing MySQL.

sudo apt update && sudo apt upgrade -y 

Step 2: Install MySQL

Use the following command to install MySQL Server.

sudo apt install mysql-server -y 

Step 3: Secure MySQL Installation

Run the security script to enhance security settings.

sudo mysql_secure_installation 

Step 4: Create a Dedicated MySQL User and Grant Privileges

Login to MySQL:

sudo mysql 

Create a new user and grant privileges:

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES; 

Exit MySQL:

EXIT; 

Step 5: Testing MySQL

Check MySQL status:

sudo systemctl status mysql 

Login with the new user:

mysql -u newuser -p 

© 2025 MySQL Installation Guide

Share this Post

Leave a Reply

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