Skip to main content

To Install MySQL Server on a Unix server Follow the below steps:


1.  Download rpm file for mysql.com website for yum installation for version MySQL 5.7.25

2.  Install rpm file to the unix machine using the below command:
        rpm -ivh {rpm_file}

3. After rpm installation search for mysql using:
       yum search mysql

4. Edit the yum.repos.d file to enable the 5.7.25 version and disable the default version 8.0
       vi /etc/yum.repos.d 

5. Install the mysql server using yum install
      yum install mysql-community-server.x86_64

6. The mysql server will be downloaded in the below path:
       /var/lib/mysql

7. Start the mysql server deamon using the below   command
      systemctl start mysqld
  
8. Check if the mysqld instance is running by using below commands
     ps -ef|grep mysql
     systemctl status mysqld

9. Check the temporary password for root generated in log files:
     grep tempo /var/log/mysqld.log

10. Login to mysql prompt using the temp password from log file
     mysql -u root -p

11.Change the temporary password for root after entering mysql prompt by setting a new password:
   mysql>  ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';


Comments