Thursday, December 31, 2020

How to install mysql in centos

 

 Step 1:

rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

Step 2:

sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo

Step 3:

yum --enablerepo=mysql80-community install mysql-community-server

Step 4:

service mysqld start

Step 5: Show temp password copy temp  password

grep "A temporary password" /var/log/mysqld.log

Step 6: Copy temp password and set new password

mysql_secure_installation

Step 7:

Enter password for user root:

The existing password for the user account root has expired. Please set a new password.

New password:
Re-enter new password:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step 8: 

service mysqld restart

Step 9: Connect mysql

mysql -u root -p

 




No comments:

Post a Comment

How to Find the Third highest salary in mysql

  set @b:=0; set @b1:=3;   # #select distinct salary,@b:=@b+1 as Row_no from emp select  * from emp where salary=( select salary from ( sele...