본문 바로가기
OS

[ubuntu 20.04] MySQL 5.7 설치

by EdwardYang 2023. 4. 27.
반응형

1단계: MySQL APT 저장소 추가

sudo apt update
sudo apt install wget -y
wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

 

sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

Ubuntu Bionic을  선택 하고  확인을 클릭합니다.
첫 번째 옵션을 선택하고  확인을 클릭합니다.
MySQL 5.7  서버를 선택하고  확인을  클릭합니다 .
마지막 옵션  확인을  선택 하고  확인을 클릭합니다.

2단계: MySQL 리포지토리 업데이트

sudo apt-get update

 

$ sudo apt-cache policy mysql-server
mysql-server:
  Installed: (none)
  Candidate: 8.0.26-0ubuntu0.20.04.2
  Version table:
     8.0.26-0ubuntu0.20.04.2 500
        500 http://mirrors.digitalocean.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     8.0.19-0ubuntu5 500
        500 http://mirrors.digitalocean.com/ubuntu focal/main amd64 Packages
     5.7.35-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages

 

3단계: Ubuntu 20.04에 MySQL 5.7 설치

 

sudo apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*

Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '5.7.35-1ubuntu18.04' (MySQL:repo.mysql.com [amd64]) for 'mysql-client'
Selected version '5.7.35-1ubuntu18.04' (MySQL:repo.mysql.com [amd64]) for 'mysql-community-server'
Selected version '5.7.35-1ubuntu18.04' (MySQL:repo.mysql.com [amd64]) for 'mysql-server'
The following additional packages will be installed:
  libmecab2 libtinfo5 mysql-common mysql-community-client
The following NEW packages will be installed:
  libmecab2 libtinfo5 mysql-client mysql-common mysql-community-client mysql-community-server mysql-server
0 upgraded, 7 newly installed, 0 to remove and 90 not upgraded.
Need to get 51.6 MB of archives.
After this operation, 315 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

 

루트 암호를 입력하고 다시 입력하십시오.

4단계: 안전한 MySQL 5.7 설치

sudo mysql_secure_installation

 

Enter current password for root (enter for none): <Enter password>
VALIDATE PASSWORD PLUGIN can be used to test passwords 
and improve security. It checks the strength of password 
and allows the users to set only those passwords which are 
secure enough. Would you like to setup VALIDATE PASSWORD plugin? 

Press y|Y for Yes, any other key for No: Y 

There are three levels of password validation policy: 

LOW    Length >= 8 
MEDIUM Length >= 8, numeric, mixed case, and special characters 
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                 

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1 
Using existing password for root. 
Estimated strength of the password: 25  
Change the password for root ? ((Press y|Y for Yes, any other key for No) : d
Remove anonymous users? [Y/n] Y 
Disallow root login remotely? [Y/n] Y 
Remove test database and access to it? [Y/n] Y 
Reload privilege tables now? [Y/n] Y 
Thanks for using MariaDB!

 

 

 

 

 

반응형

댓글