关于flask:3Flask构建弹幕微电影网站安装mysql数据库及配置

35次阅读

共计 1693 个字符,预计需要花费 5 分钟才能阅读完成。

【百度云搜寻,搜各种材料:http://www.lqkweb.com】

【搜网盘,搜各种材料:http://www.swpan.cn】

Flask 构建微电影视频网站

已上线演示地址: http://movie.tbquan.cn

装置数据库连贯依赖包

安装包flask-sqlalchemy

pip install flask-sqlalchemy

pip list
Package          Version
---------------- -------
Click            7.0
Flask            1.0.2
Flask-SQLAlchemy 2.3.2
itsdangerous     0.24
Jinja2           2.10
MarkupSafe       1.0
pip              18.1
setuptools       40.4.3
SQLAlchemy       1.2.12
Werkzeug         0.14.1
wheel            0.32.1

中文文档

http://www.pythondoc.com/flas…

查看配置键:http://www.pythondoc.com/flas…

连贯格局

MySQL: mysql://username:password@localhost/mydatabase

创立 mysql 数据库

下载 mysql

https://dev.mysql.com/downloa…

这儿间接用的最新版8.0

MySQL Community Server

学习应用下载社区版就能够

装置 mysql

关上开始菜单的 MySQL 8.0 Command Line Client 验证是否失常装置

Enter password: root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \s
--------------
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe  Ver 8.0.12 for Win64 on x86_64 (MySQL Community Server - GPL)

Connection id:          11
Current database:
Current user:           root@localhost
SSL:                    Cipher in use is DHE-RSA-AES128-GCM-SHA256
Using delimiter:        ;
Server version:         8.0.12 MySQL Community Server - GPL
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    gbk
Conn.  characterset:    gbk
TCP port:               3306
Uptime:                 2 min 20 sec

Threads: 2  Questions: 23  Slow queries: 0  Opens: 147  Flush tables: 2  Open tables: 123  Queries per second avg: 0.164
--------------

如果 cmd 中 mysql 命令不论用,须要增加环境变量,在 Path 中增加C:\Program Files\MySQL\MySQL Server 8.0\bin\,也就是 mysql 的装置目录

而后就通过以下命令能够登录了

mysql -uroot -p
Enter password: root

正文完
 0