ISSUES/시사&스터디

|Trouble Shooting| MYSQL 설치 오류날 때? -Elasticbeanstalk-

refreshment 2021. 9. 10. 11:30
728x90
반응형

공통환경: LINUX OS

 

 

 



#개발환경 1
Debian/ubuntu


window ubuntu 18.04



1. 파이썬 설치

sudo apt-get install python

sudo apt-get install python3



2. pip설치

sudo apt-get install python-pip

sudo apt-get install python3-pip




3. 파이썬 버젼3으로 변경

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2

sudo update-alternatives --config python

There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.6   2         auto mode
  1            /usr/bin/python2.7   1         manual mode
  2            /usr/bin/python3.6   2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 2






4. 가상환경 설정

pip install virtualenv
pip3 install virtualenv

python -m virtualenv venv-python2
python3 -m virtualenv venv-python3

source venv-python3/bin/activate

 

 

 

5. mysqlclient 설치 (중요⚠)

pip install libmysqlclient-dev

pip install mysqlcllient





 

 

개발환경2
Redhat/Centos

aws ec2


1. yum 업데이트

sudo yum update -y

 

2. 파이썬설치

sudo yum install python
sudo yum install python3



3. pip 설치

 

3-1) yum() 활용

yum install python-pip


3-2) 수동

curl -k -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py





python3 활용시 yum 에러 (맨윗줄에 써있는 symbolic link 수정)

- sudo vim /usr/bin/yum
#! /usr/bin/python -> #! /usr/bin/python2.7

- sudo vim /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python -> #! /usr/bin/python2.7





그럼 yum 으로 사용할때 python2를 사용하게 된다.

RPM 다운

sudo yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm


yum으로 install

sudo yum install mysql-community-server



mysql다운

sudo yum install mysql



728x90
반응형