πŸš€ Languege/Basic SQL

[MySQL 8.0] CentOS7에 MySQL 8.0μ„€μΉ˜ν•˜κΈ°

mini_world 2021. 3. 16. 19:35
λͺ©μ°¨ μ ‘κΈ°

 

μ•ˆλ…•ν•˜μ„Έμš” πŸ™‹‍♀️ πŸ™‹‍♂️ !!!

이번 ν¬μŠ€νŒ…μ—μ„œλŠ” mysql 8.0 버전을 μ„€μΉ˜ν•΄λ³΄λ €κ³  ν•©λ‹ˆλ‹€ ;)

μ €λŠ” AmazonEC2 CentOS7을 μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€!!!

 


1. MySQL μ„€μΉ˜ λ‹€μš΄λ‘œλ“œ 링크 확인

MySQL Commucity λ²„μ „μœΌλ‘œ λ‹€μš΄λ°›κΈ° μœ„ν•΄μ„œ μ•„λž˜ 링크둜 μ ‘μ†ν•˜μ„Έμš”!
μ„€μΉ˜ μ‹œμ μ— 따라 μ΅œμ‹  버전이 λ‹€λ₯΄λ―€λ‘œ μ„€μΉ˜ν•˜μ‹€λ•Œ μ•„λž˜ μˆœμ„œμ— 따라 μ„€μΉ˜ 링크λ₯Ό λ°›μ•„μ£Όμ‹œλŠ”κ²Œ μ’‹μ•„μš” :)

www.mysql.com/products/community/

 

MySQL :: MySQL Community Edition

MySQL Community Edition MySQL Community Edition is the freely downloadable version of the world's most popular open source database. It is available under the GPL license and is supported by a huge and active community of open source developers. The MySQL

www.mysql.com

 

Download MySQL Community Edition을 ν΄λ¦­ν•©λ‹ˆλ‹€.

CentOSμ΄λ―€λ‘œ, YUM λ ˆν¬μ§€ν† λ¦¬λ‘œ μ„€μΉ˜κ°€ κ°€λŠ₯ν•˜κ² μ£ !!
MySQL Yum Repositoryλ₯Ό ν΄λ¦­ν•©λ‹ˆλ‹€.

μ„€μΉ˜ν•˜λ €λŠ” OS버전에 따라 링크가 λ‹€λ₯΄κ²Œ κ΅¬μ„±λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€.
μ €λŠ” CentOS7에 μ„€μΉ˜ν•  μ˜ˆμ •μ΄λ―€λ‘œ, λ‘λ²ˆμ§Έ DownLoadλ₯Ό ν΄λ¦­ν•©λ‹ˆλ‹€.

λ‹€μš΄λ‘œλ“œ νŽ˜μ΄μ§€ μž…λ‹ˆλ‹€. 
μ•„λž˜ "No Thanks, just start my download."λ₯Ό ν΄λ¦­ν•˜λ©΄ λ‹€μš΄λ‘œλ“œκ°€ μ‹œμž‘λ©λ‹ˆλ‹€.
마우슀 였λ₯Έμͺ½ 클릭 ν›„ 링크 μ£Όμ†Œλ₯Ό λ³΅μ‚¬ν•΄μ€λ‹ˆλ‹€!!

 


2. MySQL Repository μ„€μΉ˜

이제, CentOS7 μ—μ„œ μ•„λž˜μ™€ 같이 λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•©λ‹ˆλ‹€.

[root@mysql-host ~]# sudo yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

이제 MySQL을 μ„€μΉ˜ν•  수 μžˆλŠ” λ ˆν¬μ§€ν† λ¦¬ μ„€μΉ˜κ°€ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.
yum repolist λͺ…λ Ήμ–΄λ‘œ 방금 μ„€μΉ˜λœ mysql λ ˆν¬μ§€ν† λ¦¬ λͺ©λ‘μ„ 확인해볼 수 μžˆμŠ΅λ‹ˆλ‹€. 

[root@mysql-host ~]# yum repolist enabled | grep "mysql.*"

yum search λͺ…λ Ήμ–΄λ‘œ μ„€μΉ˜ κ°€λŠ₯ν•œ mysql νŒ¨ν‚€μ§€ λͺ©λ‘λ„ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

[root@mysql-host ~]# yum search mysql

 


3. MySQL μ„€μΉ˜

이제, μ§„μ§œλ‘œ μ„€μΉ˜ν•΄λ΄…μ‹œλ‹€!

[root@mysql-host ~]# yum install -y mysql-server

<쀑간 μƒλž΅>

mysqld -V ν˜Ήμ€ mysql -version λͺ…λ Ήμ–΄λ‘œ mysql버전을 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

[root@mysql-host ~]# mysqld -V

 

 


4. MySQL μ„œλ²„ μ‹œμž‘ 및 접속

MySQL μ„œλ²„λ₯Ό μ‹œμž‘ν•΄λ΄…μ‹œλ‹€.

[root@mysql-host ~]# systemctl enable mysqld && systemctl start mysqld && systemctl status mysqld

mysql 8.0버전은 μ„œλ²„ μ„€μΉ˜κ³Όμ •μ—μ„œ μž„μ‹œ λΉ„λ°€λ²ˆν˜Έκ°€ μƒμ„±λ˜λ©°,  이 λΉ„λ°€λ²ˆν˜Έλ‘œ 접속이 κ°€λŠ₯ν•©λ‹ˆλ‹€ :)
μ•„λž˜ λͺ…λ Ήμ–΄λ‘œ μž„μ‹œ λͺ…λ Ήμ–΄λ₯Ό ν™•μΈν•΄λ΄…μ‹œλ‹€! 

[root@mysql-host ~]# grep 'temporary password' /var/log/mysqld.log

이제 μ ‘μ†ν•΄λ΄…λ‹ˆλ‹€ :)
μœ„μ—μ„œ ν™•μΈν•œ λΉ„λ°€λ²ˆν˜Έλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€!

[root@mysql-host ~]# mysql -u root -p

 


5. Root 계정 λΉ„λ°€λ²ˆν˜Έ λ³€κ²½

이제 μ ‘μ†ν•΄μ„œ 뭘 μ’€ 해보렀고 ν–ˆλ”λ‹ˆ, 세상에 였λ₯˜κ°€ λΏœμ–΄μ Έ λ‚˜μ˜€λ„€μš” :)

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

root μœ μ €μ˜ λΉ„λ°€λ²ˆν˜Έλ₯Ό λ³€κ²½ν•΄μ€μ‹œλ‹€!
λΉ„λ°€λ²ˆν˜Έ λ³€κ²½ν›„μ—λŠ” λͺ…λ Ήμ–΄κ°€ 잘 μ‹€ν–‰ λ˜λ„€μš” ;)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Xptmxm1212!@';

 

기본적인 μ„€μΉ˜λŠ” μ—¬κΈ°μ—μ„œ 마무리 ν•˜κ² μŠ΅λ‹ˆλ‹€.

λ‹€μŒ ν¬μŠ€νŒ…μ—μ„œ λ‹€μ‹œ λ§Œλ‚˜μš”~! Bye~~~!


 

 

728x90