docker run -itd --name mysql_python -v /home/ubuntu/docker/mysql/:/var/lib/mysql/ p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
docker run -idt --name tornado_python -v /home/ubuntu/pythonproject/tornado/:/tornado/ -p 8000:8000 -p 8002:8002 -p 8003:8003 --link mysql_python:mysql_python python:3.6
docker run -idt --network host --name nginx_tornado -v /home/ubuntu/pythonproject/tornado/newssysytem_tornado/deploy/tornado_nginx.conf:/etc/nginx/conf.d/tornado_nginx.conf nginx
创建用户
CREATE USER 'zhangsan'@'%' IDENTIFIED BY zhangsan123';
授予所有权限
GRANT ALL PRIVILEGES ON *.* TO 'zhangsan'@'%' WITH GRANT OPTION;
# [RuntimeError: cryptography is required for sha256_password or caching_sha2_p](https://www.cnblogs.com/Hannibal-2018/p/11081143.html)
# 报错原因:mysql版本身份验证出现问题引起的
## 我这里报错的地方是在Django里,pycharm连接数据库时出现的
### **解决办法,安装安装cryptography即可:pip install cryptography 或者 pycharm里直接安装也可以**
pip install mysqlclient
sudo apt-get install python3 python-dev python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev python-pip
网友评论