-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_MysqlInstallation.txt
30 lines (29 loc) · 1.17 KB
/
01_MysqlInstallation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#------------------------------------
#------------------------------------
#ALAN SANTOS
#THIS ARE THE STEPS I PERFORMED TO
#INSTALL MYSQL ON AMAZON LINUX 2 AND
#ABLE TO CONNECT REMOTLY
#------------------------------------
#------------------------------------
sudo yum update -y
sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum --enablerepo=mysql80-community install mysql-community-server
sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
sudo yum install mysql-community-server -y
sudo systemctl stop mysqld.service
sudo systemctl start mysqld.service
sudo yum install mysql-devel -y
#kill `cat mysqld.pid`
#sudo grep 'temporary password' /var/log/mysqld.log
MYSQLTMPPWD=$(sudo grep 'temporary password' /var/log/mysqld.log | rev | cut -d" " -f1 | rev)
echo "${MYSQLTMPPWD}"
mysql -u root -p''"${MYSQLTMPPWD}"'' -h 127.0.0.1 -P 3306 -D mysql
#CHANGE HERE YOUR TEMP PASSWORD
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Teste!123';
#EXIT MYSQL AND TEST IT!
mysql -u root -p'Teste!123'
#ALLOW REMOTE CONNECT
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Teste!123';
FLUSH PRIVILEGES;
#EXIT MYSQL!