How to Install MySQL 5.7 on CentOS | Install MySQL 5.7 with mysql_secure_installation in CentOS7

Опубликовано: 08 Январь 2022
на канале: Prakash tech
671
7

How to Install MySQL 5.7 on CentOS | Install MySQL on CentOS 7 | Install MySQL 5.7 with mysql_secure_installation in CentOS7/RHEL7 | How To Install Mysql Server 5.7 On Centos 7

Mysql 5.7 Installation
Enable MySQL Repository

yum localinstall https://dev.mysql.com/get/mysql57-com...
noarch.r
Install MySQL 5.7 Server
yum install mysql-community-server

GET Temp root Password
grep 'A temporary password' /var/log/mysqld.log |tail -1

Output like:
L=dZQ8lgvdZy

Start MySQL Service
service mysqld start

Secure insallation:
/usr/bin/mysql_secure_installation
SET Net root Passowrd *

#mysql -h localhost -u root -p
Or
mysql -u root –p

GRANT ALL PRIVILEGES ON . TO 'root'@'192.168.1.13' IDENTIFIED BY 'XXX@123';
service mysqld restart
Edit Mysql config file:

vi /etc/my.cnf
Stop firewall
sudo systemctl stop firewalls

Centos mysql host 'XXX' is not allowed to connect to this mysql server
mysql -u root -p
use mysql;
**replace single quotes
update user set host=’%’ where host=’localhost’ and user=’root’;
flush privileges;
Service mysqld restart