赵走x博客
网站访问量:152032
首页
书籍
软件
工具
古诗词
搜索
登录
Python3网络爬虫实战:46、付费讯代理、阿布云代理的使用
Python3网络爬虫实战:45、代理池的维护
Python3网络爬虫实战:44、代理的设置
Python3网络爬虫实战:43、微博宫格验证码的识别
Python3网络爬虫实战:42、点触点选验证码的识别
Python3网络爬虫实战:41、极验滑动验证码的识别
Python3网络爬虫实战:40、图形验证码的识别
Python3网络爬虫实战:38、动态渲染页面抓取:Splash的使用
Python3网络爬虫实战:37、动态渲染页面抓取:Selenium
Python3网络爬虫实战:36、分析Ajax爬取今日头条街拍美图
Python3网络爬虫实战:35、 Ajax数据爬取
Python3网络爬虫实战:34、数据存储:非关系型数据库存储:Redis
Python3网络爬虫实战:33、数据存储:非关系型数据库存储:MongoDB
Python3网络爬虫实战:32、数据存储:关系型数据库存储:MySQL
Python3网络爬虫实战:31、数据存储:文件存储
Python3网络爬虫实战:30、解析库的使用:PyQuery
Python3网络爬虫实战:29、解析库的使用:BeautifulSoup
Python3网络爬虫实战:28、解析库的使用:XPath
Python3网络爬虫实战:27、Requests与正则表达式抓取猫眼电影排行
Python3网络爬虫实战:26、正则表达式
Python3网络爬虫实战:25、requests:高级用法
Python3网络爬虫实战:24、requests:基本使用
Python3网络爬虫实战:23、使用Urllib:分析Robots协议
Python3网络爬虫实战:21、使用Urllib:处理异常
Python3网络爬虫实战:22、使用Urllib:解析链接
Python3网络爬虫实战:20、使用Urllib发送请求
Python3网络爬虫实战:19、代理基本原理
Python3网络爬虫实战:18、Session和Cookies
Python3网络爬虫实战:17、爬虫基本原理
Python3网络爬虫实战:16、Web网页基础
Python3网络爬虫实战:15、爬虫基础:HTTP基本原理
Python3网络爬虫实战:14、部署相关库的安装:Scrapyrt、Gerapy
Python3网络爬虫实战:13、部署相关库的安装:ScrapydClient、ScrapydAPI
Python3网络爬虫实战:12、部署相关库的安装:Docker、Scrapyd
Python3网络爬虫实战:11、爬虫框架的安装:ScrapySplash、ScrapyRedis
Python3网络爬虫实战:10、爬虫框架的安装:PySpider、Scrapy
Python3网络爬虫实战:9、APP爬取相关库的安装:Appium的安装
Python3网络爬虫实战:8、APP爬取相关库的安装:MitmProxy的安装
Python3网络爬虫实战:7、APP爬取相关库的安装:Charles的安装
Python3网络爬虫实战:6、Web库的安装:Flask、Tornado
Python3网络爬虫实战:5、存储库的安装:PyMySQL、PyMongo、RedisPy、RedisDump
Python3网络爬虫实战:4、数据库的安装:MySQL、MongoDB、Redis
Python3网络爬虫实战:3、解析库的安装:LXML、BeautifulSoup、PyQuery、Tesserocr
Python3网络爬虫实战:2、安装:GeckoDriver、PhantomJS、Aiohttp
Python3网络爬虫实战:1、请求库安装:Requests、Selenium、ChromeDriver
Python3网络爬虫实战:4、数据库的安装:MySQL、MongoDB、Redis
资源编号:75748
Python3网络爬虫实战
爬虫
热度:80
作为数据存储的重要部分,数据库同样是必不可少的,数据库可以分为关系型数据库和非关系型数据库。
作为数据存储的重要部分,数据库同样是必不可少的,数据库可以分为关系型数据库和非关系型数据库。 关系型数据库如 SQLite、MySQL、Oracle、SQL Server、DB2 等,其数据库是以表的形式存储,非关系型数据库如MongoDB、Redis,它们的存储形式是键值对,存储形式更加灵活。 本书用到的数据库主要有关系型数据库 MySQL 及非关系型数据库 MongoDB、Redis。 本节我们来了解一下它们的安装方式。 # 1.3.1 MySQL的安装 MySQL 是一个轻量级的关系型数据库,以表的形式来存储数据,本节我们来了解下它的安装方式。 #### 1. 相关链接 * 官方网站:https://www.mysql.com/cn * 下载地址:https://www.mysql.com/cn/downloads * 中文教程:http://www.runoob.com/mysql/mysql-tutorial.html #### 2. Mac下的安装 推荐使用 Homebrew 安装,执行 brew 命令即可。 ``` brew install mysql ``` 启动、停止、重启 MySQL 服务的命令: ``` sudo mysql.server start sudo mysql.server stop sudo mysql.server restart ``` Mac 一般不会作为服务器使用,如果要想取消本地 host 绑定,同样修改 my.cnf 文件,然后重启服务即可。 # 1.3.2 MongoDB安装 MongoDB 是由 C++ 语言编写的非关系型数据库,是一个基于分布式文件存储的开源数据库系统,其内容存储形式类似 Json 对象,它的字段值可以包含其他文档,数组及文档数组,非常灵活。 MongoDB 支持多种平台,包括 Windows、Linux、Mac OS、Solaris 等,在其官方网站均可找到对应的安装包,https://www.mongodb.com/download-center 本节我们来看下它的安装过程。 #### 1. 相关链接 * 官方网站:https://www.mongodb.com * 官方文档:https://docs.mongodb.com * GitHub:https://github.com/mongodb * 中文教程:http://www.runoob.com/mongodb/mongodb-tutorial.html #### 2. Mac下的安装 推荐使用 Homebrew 安装,执行 brew 命令即可: ``` brew install mongodb ``` 然后创建一个新文件夹 /data/db,用于存放 MongoDB 数据。 启动 MongoDB 服务: ``` brew services start mongodb sudo mongod ``` 这样就启动了 MongoDB 服务。 停止、重启 MongoDB 服务的命令: ``` brew services stop mongodb brew services restart mongodb ``` #### 3. 可视化工具 在这里推荐一个可视化工具 RoboMongo/Robo 3T,使用简单,功能强大,官方网站:https://robomongo.org/,三大平台都有支持,下载链接:https://robomongo.org/download。 另外还有一个简单易用的可视化工具,Studio 3T,同样具有方便的图形化管理,官方网站:https://studio3t.com,同样支持三大平台,下载链接:https://studio3t.com/download/。 # 1.3.3 Redis的安装 Redis 是一个基于内存的高效的非关系型数据库,本节我们来了解下 Redis 在各个平台的安装过程。 #### 1. 相关链接 * 官方网站:https://redis.io * 官方文档:https://redis.io/documentation * 中文官网:http://www.redis.cn * GitHub:https://github.com/antirez/redis * 中文教程:http://www.runoob.com/redis/redis-tutorial.html * Redis Desktop Manager:https://redisdesktop.com * Redis Desktop Manager GitHub:https://github.com/uglide/RedisDesktopManager #### 2. Mac下的安装 推荐使用 Homenbrew 安装,执行 brew 命令即可。 ``` brew install redis ``` 启动 Redis 服务: ``` brew services start redis redis-server /usr/local/etc/redis.conf ``` 这样就启动了 Redis 服务。 同样可以使用 redis-cli 进入 Redis 命令行模式。 Mac 下 Redis 的配置文件路径是 /usr/local/etc/redis.conf,可以通过修改它来配置访问密码。 修改配置文件后需要重启 Redis 服务,停止、重启 Redis 服务的命令如下: ``` brew services stop redis brew services restart redis ``` 另外在 Mac 下也可以安装 Redis Desktop Manager 可视化管理工具来管理 Redis。