Install MySQL 5.7 on CentOS 7

I had to get MySQL up and running on a development CentOS 7 virtual machine.  I just wanted to outline the steps I ran through in order to get it running, and be able to connect to it from my workstation.   Please keep in mind this is all in development, so do not consider these steps for production level servers.

sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
sudo firewall-cmd --reload

sudo yum install wget

wget http://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpm

sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm

sudo yum update

sudo yum install mysql-server

sudo yum install nano

sudo nano /etc/my.cnf
    bind-address=172.36.0.6

sudo systemctl start mysqld

sudo grep 'temporary password' /var/log/mysqld.log

sudo mysql_secure_installation

mysql -u root -p

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

CREATE USER 'username'@'%' IDENTIFIED BY 'changeme';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
FLUSH PRIVILEGES;

exit

Leave a comment