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

    • 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 ...
    • How to Install and Configure PowerDNS on centos 7 using MariaDB.

      PowerDNS is a DNS server that works on many derivatives from Linux / Unix. It can be configured with various backends, including zone files of the BIND style, relational databases and failover / load balancing. The DNS recurrent can also be set up as ...
    • How to Install PHP in CentOS 7

      PHP is the part of our setup that processes code for dynamic content display. It can run scripts, link to our MySQL databases, and view processed content to our web server. Step 1: We can use the following command for the installation of our ...
    • 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 : ...