https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7
https://dev.mysql.com/downloads/repo/yum/
https://tecadmin.net/install-mysql-5-7-centos-rhel/
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
md5sum mysql57-community-release-el7-9.noarch.rpm
sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
sudo yum install mysql-server
sudo systemctl start mysqld
sudo systemctl status mysqld
Note: MySQL is automatically enabled to start at boot when it is installed.
You can change that default behavior with sudo systemctl disable mysqld
sudo grep ‘temporary password’ /var/log/mysqld.log
sudo mysql_secure_installation
mysqladmin -u root -p version
/* CREATE NEW DATABASE */
mysql> CREATE DATABASE mydb;
/* CREATE MYSQL USER FOR DATABASE */
mysql> CREATE USER ‘db_user’@’localhost’ IDENTIFIED BY ‘password’;
/* GRANT Permission to User on Database */
mysql> GRANT ALL ON mydb.* TO ‘db_user’@’localhost’;
/* RELOAD PRIVILEGES */
mysql> FLUSH PRIVILEGES;