In today’s advanced big data ecosystem, MySQL stands out as a widely recognized technology. It has gained popularity and proven to be an effective database solution in various industries. You don’t need extensive knowledge to become proficient in managing this database system. Even if you’re new to relational systems, you can leverage MySQL to create robust storage systems that are secure and performant.
In this article, we will walk you through the process of installing MySQL on Ubuntu 22.04. So, let’s get started!
Installing MySQL on Ubuntu 22.04: Step-by-Step Guide
To successfully install MySQL on Ubuntu 22.04, you need to carefully follow the step-by-step instructions provided below.
Step 1: Update Linux server
To update we use the following command:
$ sudo apt update
Step 2: Install MySQL on your Ubuntu 22.04
In the next Step we will install MySQL on our Linux server with the following command:
$ sudo apt-get install mysql-server
After that wait few minutes till the installation is complete
Step 3: Check if u have installed MySQL successfully
We check the mySQL installation with the following command:
$ systemctl is-active mysql
Step 4: Configure your MySQL server
Next, you need to execute the command provided below to initiate the initial configuration process for the MySQL server. This interactive configuration will allow you to set up the server according to your preferences.
$ sudo mysql_secure_installation
After that, type out the new password for “root” and enter “y” to continue with the provided password
Also, set the other configuration options right
Step 5: Login into your fresh installed MySQL server
Afterward, proceed to log in to the MySQL server in order to configure the default authentication method as “mysql_native_password” and establish a native password for the root user.
$ sudo mysql
As you can see, the following query will set the root password to “Password111#@!” and the authentication method to “mysql_native_password”:
> ALTER USER ‘root’@‘localhost’
IDENTIFIED WITH mysql_native_password BY ‘Password111#@!’;
To apply the changes without restarting the “mysql” service, it is necessary to reload the grant tables in the MySQL database. This ensures that the modifications take effect seamlessly:
> FLUSH PRIVILEGES;
Once again, attempt to log in to the MySQL server using the password you previously set:
The output provided above, without any errors, indicates that the installation and configuration of MySQL on our Ubuntu 22.04 system were successful.
To verify that the MySQL service is running, you can execute the following command:
$ systemctl status mysql.service
We have provided a comprehensive method for installing MySQL on Ubuntu 22.04. Give it a try and explore the capabilities of this remarkable database management system.
In conclusion, to install MySQL on Ubuntu 22.04, begin by enabling the system repositories and then proceed with the “sudo apt-get install mysql-server” command. Next, configure the MySQL installation on your system using the “sudo mysql_secure_installation” command. The configuration manual will guide you through setting the password validation policy, removing the test database and its access, and reloading the privileges. This guide has covered the installation process of MySQL on Ubuntu 22.04.