Skip to content

Instantly share code, notes, and snippets.

@2minchul
Last active April 14, 2020 06:30
Show Gist options
  • Save 2minchul/3435793d65c359b15120e3b02e98a915 to your computer and use it in GitHub Desktop.
Save 2minchul/3435793d65c359b15120e3b02e98a915 to your computer and use it in GitHub Desktop.
install mysql5.7 on Amazon Linux 2

add MySQL Yum Repository

sudo amazon-linux-extras install epel
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum localinstall mysql80-community-release-el7-3.noarch.rpm

yum repolist enabled | grep "mysql.*-community.*" to check default mysql version

enable mysql5.7

sudo yum-config-manager --disable mysql80-community
sudo yum-config-manager --enable mysql57-community

install mysql5.7

yum update -y
yum install mysql57-community -y

run

systemctl start mysqld
systemctl enable mysqld

get temporary password and run mysql_secure_installation

grep 'password' /var/log/mysqld.log
mysql_secure_installation

add new user

mysql -p to connect locahost mysql

use mysql;
CREATE user 'admin'@'%' identified by 'password';
# GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' identified by 'password' with grant option;
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment