Tuesday, 14 August 2018

Installing mysql on centos7

Versions:
 Mysql   : 5.7.23
 Centos : CentOS Linux release 7.4.1708 (Core)


1) Download mysql
 wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

2)Creating yum repository
 sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm

3)Install
  sudo yum install mysql-server

4)Starting mysql
  sudo systemctl start mysqld

5)Finding default password for root user
 On fresh installation default username will be 'root' and a temporary      password    will be automatically generated, that password
 can be found using following command 

 grep 'temporary password' /var/log/mysqld.log
 output:
  2018-08-14T08:49:40.599534Z 1 [Note] A temporary password is generated for root@localhost: ioOi9F#W8OM1

6)Reset the password
 Get into mysql console using following command [password from step-5]
 mysql -uroot -pioOi9F#W8OM1 

 Reset root password using following query
 alter user user() identified by 'desired_password'

 Thats all! Now you can play around with newly installed mysql in centos-7.

No comments:

Post a Comment