Installation of Mysql server on CentOS 7

Installation of Mysql server on CentOS 7

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.


Step 7 : Configuration of Mysql server

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 !!


    • Related Articles

    • INSTALLATION AND CONFIGURATION OF APACHE TOMCAT 9 ON CENTOS 7

      Apache Tomcat program is an open-source application of Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. Under the Java Community Process the Java Servlet, JavaServer Pages, Java Expression Language and Java ...
    • How to change mysql port number in centOS 7

      Default port of mysql is 3306 . To change the default port to custom port , Please follow the below steps :-  Step 1 : First , use the below command to check the availability of port (port is free or not) . Command : netstat -tanp|grep 3337 Step 2 : ...
    • Install CWP in Centos 7

      CWP is an free and paid license based hosting panel for managing website database,emails,file,etc using a single Panel. In this article we will discuss how to install CWP in Centos 7 Software Requirements You must have a clean/fresh installation of ...
    • How To Configure BIND as a Private Network DNS Server on CentOS 7

      A DNS or Domain Name System is a distributed database, allows the association of zone records, for example, IP addresses with domain names. If a computer, like your laptop or phone, has to communicate over the internet, they use each other IP ...
    • How to Install (Linux, Apache, MariaDB, PHP) LAMP Stack on CentOS 7

      LAMP, which operates Linux as the operating system, is an open-source web-developing platform using Apache as the web-based server and PHP as an object-oriented scripting language. (Instead of PHP, Perl or Python are sometimes used.) Prerequisites ...