3、Flask构建弹幕微电影网站-安装mysql数据库及配置

百度云搜索,搜各种资料: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...

BLOG_20181028_122213_58

连接格式

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

创建mysql数据库

下载mysql

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

这儿直接用的最新版8.0

MySQL Community Server

学习使用下载社区版就可以

安装mysql

BLOG_20181028_122220_14

BLOG_20181028_122240_15

BLOG_20181028_122247_66

打开开始菜单的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

你可能感兴趣的:(flask)