How to install MySQL 8.0 on Ubuntu 22.04, 24.04

MySQL 8.0 is widely used by applications to store and manage data securely. It powers websites, eCommerce platforms, and custom apps by handling user data, transactions, and content. Applications connect to MySQL using languages like PHP, Python, Node.js, or Java to run queries and manage information efficiently.
Here’s a step-by-step guide to install MySQL 8.0 on Ubuntu 24.04:
Step 1: Update Package System
#sudo apt update && sudo apt upgrade -y

Step 2: Install Prerequisites
# sudo apt install wget gnupg lsb-release -y

Step 3: Install MySQL 8.0
Now We have to install MYSQl 8.0 By default with this command:
# sudo apt install mysql-server

Step 4: Start & Enable MySQL
Ensure that the server is running using the systemctl start
command:
# sudo systemctl start mysql.service
# sudo systemctl enable mysql

Check status:
# systemctl status mysql

Step 5: Secure MySQL Installation
# sudo mysql_secure_installation
You’ll be prompted to:
Set root password = N
Remove anonymous users = Y
Disallow remote root login = Y
Remove test database = Y
Reload privilege tables = Y


Now All Done!
Step 6: Verify MySQL Version
# mysql –version

Thanks for Watching…