LoginSignup
1
4

More than 3 years have passed since last update.

PythonとMySQLを接続する手順

Posted at

Django インストールから設定まで

インストール

sudo apt update
sudo apt upgrade

Python install


sudo apt install python3
sudo apt install python3-pip

mysql install

sudo apt install mysql-server mysql-client
sudo mysql_secure_installation
sudo apt-get install python3-dev

mysql_secure_installation コマンドを実行し、管理者(root)パスワードなどインストール後の初期設定を行う。基本的には「y」で進める。

django に必要なライブラリをインストール

pip3 install mysqlclient
pip3 install Django
pip3 install mysqlclient
1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4