Install mysql yum repo
# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
Install mysql-community-server
# yum install -y mysql-community-server
Start mysql server
# systemctl start mysqld
Get the default mysql root password from mysqld.log
# grep 'temporary password' /var/log/mysqld.log
Login to the mysql console, and change the root password
# mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewP@ssword!123';
mysql> exit
If you are using centos internal firewall, allow access to mysql port
# firewall-cmd --add-service mysql
# firewall-cmd --add-service mysql --permanent
No comments:
Post a Comment