MySQL is an open-source relational database management system . Its name consists a combination of ‘My’ and ‘SQL’ as the name for the Structured Query Language of the co-founder Michael Widenius’s daughter.
Step 1: Login into the server using root credentials on putty .
Step 2 :Download the MySQL packages from official website by the following command:
# wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
Step 3 : We have checked that the file has not been corrupted or modified, we are going to install the package:
Command :
# rpm -ivh mysql57-community-release-el7-9.noarch.rpm
Step 4 : It introduces two additional MySQL yum repositories and we can use them in MySQL server installation:
Command : #yum install mysql-server
To indicate you want to continue, click ‘y’
Step 5 : With the following command we will start the mysql service
Command : systemctl start mysqld
Step 6 : Check the mysql service status by the following command:
Command : systemctl status mysqld
Step 7 : A temporary password for the MySQL root user is created during the installation process. Find it with the following command in mysqld.log:
Command : # grep temporary password /var/log/mysqld.log
Note the password(Shown with arrow sign in the above screenshot) that is required to protect your installation in the next step and where you are forced to change it. The default authentication policy requires 12 letters, with at least one letter from an upper case and one letter from a lowercase also a special character.
To run a security script, use this command:
# mysql_secure_installation
Create a new 12-character password with at least one uppercase letter, one lowercase letter, and one special character. When asked, type it again.
Your new password is good and you’re asked to change it right away. You should receive feedback. You can easily say no because you have just done it:
Output:
Estimated strength of the password: 100
Change the password for root ? (Press y|Y for Yes, any other key for No) :
If we reject the request to rework the password, we must press Y and then Enter all of the following questions so that the anonymous users can be removed, the remote key can be disabled also test database will be removed.
Step 8 : After completion of the installation we can enable the service of Mysql
Command : systemctl enable mysqld
Step9 : We can check the MySQL while login using below command.
Command : mysql -u root -p
Thank you !!