Close Menu
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

[contact-form-7 id="dd1f6aa" title="Newsletter"]
What's Hot

How to Extend the Space of Root Partition in Linux

September 15, 2025

Threat Modeling for Individuals – Pixelated Dwarf

September 15, 2025

What You Need to Know

September 15, 2025
Facebook X (Twitter) Instagram
Facebook Mastodon Bluesky Reddit
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
Home»Linux»Install MySQL on Ubuntu 24.04
Linux

Install MySQL on Ubuntu 24.04

MarkBy MarkMay 23, 2025No Comments4 Mins Read
Install MySQL on Ubuntu 24.04


How to Install MySQL on Ubuntu 24.04: A Comprehensive Guide

MySQL is a powerful and widely-used relational Database Management System (DBMS) that utilizes Structured Query Language (SQL) for data management. Commonly found in LAMP stacks on Linux, MySQL can also be installed independently. If you’re a Linux enthusiast or developer looking to set up MySQL on Ubuntu 24.04, you’re in the right place. This article provides a straightforward and detailed guide to help you install and configure MySQL successfully.

Step-by-Step Guide to Install MySQL on Ubuntu 24.04

Step 1: Update Your System’s Repository

Before installing any package, it’s essential to update your system’s repository. This ensures that you have access to the latest versions of software packages. Open your terminal and execute the following command:

$ sudo apt update

Step 2: Install MySQL Server

Once the repository is updated, you can install the MySQL server package. This is done by running the following command:

$ sudo apt install mysql-server

After the installation process, you need to start the MySQL service by executing:

$ sudo systemctl start mysql.service

Step 3: Configure MySQL Security Settings

It’s crucial to configure some basic security settings for MySQL after installation. Access the MySQL shell using the command below:

$ sudo mysql

Next, secure your MySQL installation by setting a password for the root user. Use the following syntax:

ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘your_password’; 

Make sure to replace ‘your_password’ with a strong password!

After setting the password, exit the shell:

EXIT;

Step 4: Run the MySQL Security Script

MySQL provides a built-in security script that you can run to enhance the security of your database. Execute the following command:

$ sudo mysql_secure_installation

This script will walk you through various settings, including the option to remove anonymous users and limit root access. Follow the prompts to customize these settings based on your needs.

Step 5: Modify the Authentication Method

For better authentication practices, it’s often recommended to use the auth_socket plugin. Re-enter the MySQL shell:

$ sudo mysql

Then, execute the command below to alter the authentication plugin:

ALTER USER ‘root’@’localhost’ IDENTIFIED WITH auth_socket;

Step 6: Create a New MySQL User

For security and best practices, it’s advisable to create a new user instead of using the root account. Create a new user with the desired username and password using:

CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘password’; 

Replace ‘username’ and ‘password’ with your chosen credentials.

After creating the user, specify their privileges. Here’s how to grant a new user rights to manage all databases:

GRANT CREATE, ALTER, INSERT, UPDATE, SELECT ON *.* TO ‘username’@’localhost’ WITH GRANT OPTION;

Flush the privileges and exit MySQL:

FLUSH PRIVILEGES;
EXIT;

Step 7: Verify User Permissions

Finally, confirm that your newly created user can access the database and has the proper permissions. First, check the MySQL service status:

$ sudo systemctl status mysql

Now, log in using the new user credentials:

$ mysql -u username -p

If you log in successfully, congratulations! You’ve installed and configured MySQL on Ubuntu 24.04 effectively.

Conclusion

MySQL is a fundamental component for many applications, especially in web development. This guide detailed the step-by-step process to install MySQL on Ubuntu 24.04, covering all the necessary configurations along the way. By following these steps, you can harness the full power of MySQL on your Linux setup, turning it into a robust data management solution.

FAQ

What is MySQL used for?

MySQL is primarily used for managing structured data in relational databases. It’s widely adopted for web applications, data warehousing, and e-commerce platforms.

Can I install MySQL without a graphical interface?

Yes, you can install MySQL entirely through the command line, making it ideal for server environments and remote installations.

What’s the difference between MySQL and other DBMS?

MySQL stands out for its high performance, reliable transaction support, and open-source nature, making it a popular choice compared to alternatives like PostgreSQL and SQLite.



Read the original article

0 Like this
install MySQL Ubuntu
Share. Facebook LinkedIn Email Bluesky Reddit WhatsApp Threads Copy Link Twitter
Previous ArticleAI 2027 forecasts a world utterly changed by artificial intelligence
Next Article Windows 11 Notepad gets AI-powered text writing capabilities

Related Posts

Linux

How to Extend the Space of Root Partition in Linux

September 15, 2025
Linux

Threat Modeling for Individuals – Pixelated Dwarf

September 15, 2025
Linux

What You Need to Know

September 15, 2025
Add A Comment
Leave A Reply Cancel Reply

Top Posts

AI Developers Look Beyond Chain-of-Thought Prompting

May 9, 202515 Views

6 Reasons Not to Use US Internet Services Under Trump Anymore – An EU Perspective

April 21, 202512 Views

Andy’s Tech

April 19, 20259 Views
Stay In Touch
  • Facebook
  • Mastodon
  • Bluesky
  • Reddit

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

About Us

Welcome to IOupdate — your trusted source for the latest in IT news and self-hosting insights. At IOupdate, we are a dedicated team of technology enthusiasts committed to delivering timely and relevant information in the ever-evolving world of information technology. Our passion lies in exploring the realms of self-hosting, open-source solutions, and the broader IT landscape.

Most Popular

AI Developers Look Beyond Chain-of-Thought Prompting

May 9, 202515 Views

6 Reasons Not to Use US Internet Services Under Trump Anymore – An EU Perspective

April 21, 202512 Views

Subscribe to Updates

Facebook Mastodon Bluesky Reddit
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2025 ioupdate. All Right Reserved.

Type above and press Enter to search. Press Esc to cancel.