相信很多小伙伴想学习数据库方面的知识,数据库种类有很多,人邮君在此推荐MySQL数据库。
MySQL是一个小型关系型数据库管理系统,由于其占用空间小、速度快、总体拥有成本低,尤其是开放源码这一特点,被广泛地应用在Internet上的中小型网站中。
首先根据自己需要,选择合适的MySQL版本。
#pgc-card .pgc-card-href { text-decoration: none; outline: none; display: block; width: 100%; height: 100%; } #pgc-card .pgc-card-href:hover { text-decoration: none; } /*pc 样式*/ .pgc-card { box-sizing: border-box; height: 164px; border: 1px solid #e8e8e8; position: relative; padding: 20px 94px 12px 180px; overflow: hidden; } .pgc-card::after { content: " "; display: block; border-left: 1px solid #e8e8e8; height: 120px; position: absolute; right: 76px; top: 20px; } .pgc-cover { position: absolute; width: 162px; height: 162px; top: 0; left: 0; background-size: cover; } .pgc-content { overflow: hidden; position: relative; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .pgc-content-title { font-size: 18px; color: #222; line-height: 1; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pgc-content-desc { font-size: 14px; color: #444; overflow: hidden; text-overflow: ellipsis; padding-top: 9px; overflow: hidden; line-height: 1.2em; display: -webkit-inline-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pgc-content-price { font-size: 22px; color: #f85959; padding-top: 18px; line-height: 1em; } .pgc-card-buy { width: 75px; position: absolute; right: 0; top: 50px; color: #406599; font-size: 14px; text-align: center; } .pgc-buy-text { padding-top: 10px; } .pgc-icon-buy { height: 23px; width: 20px; display: inline-block; background: url(https://lf6-cdn-tos.bytescm.com/obj/cdn-static-resource/pgc/v2/pgc_tpl/static/image/commodity_buy_f2b4d1a.png); } MySQL是怎样运行的 从根儿上理解MySQL ¥73.7 购买MySQL 常见版本有
MySQL Community Server 社区版本,开源免费,但不提供官方技术支持。MySQL Enterprise Edition 企业版本,需付费,可以试用 30 天。MySQL Cluster 集群版,开源免费。可将几个 MySQL Server 封装成一个 Server。MySQL Cluster CGE 高级集群版,需付费然后,就跟着人邮君一起来安装MySQL吧!
Windows 下安装 MySQL
1、下载安装包
官网下载对应的安装包,根据需要下载对应的版本即可:
8.0:https://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-8.0.18.0.msi
5.7:https://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-5.7.28.0.msi
当然也可以选择自己需要的版本:https://downloads.mysql.com/archives/installer/
2、安装过程







安装包的方式比较简单,根据提示完成对应的操作即可(不同的版本可能有所区别,但是都大同小异),这种方式适合于新手使用,一般开发者都建议使用压缩包的方式完成。
3、Windows下安装
1.首先记住自己的压缩包解压在哪个文件目录(一定要记住MySQL安装目录!):

2.然后进入计算机的环境变量 ,双击系统变量里的path

3.然后新建一个环境变量将第一步解压后压缩包所在的位置复制过来,粘贴进去

4.修改配置文件(用文本编辑器打开my.ini),将第一步目录位置(就是压缩包解压的位置)粘贴到这两个变量中
basedir
datadir

5.初始化命令(记录控制台给出的随机密码,一定记住!):mysqld --initialize --console

6. 然后先给mysql服务创建名称(方便到时候建立多个mysql服务时不冲突) mysqld --install mysql8

7. 启动服务: net start mysql

8. 登陆旧密码登陆(第3步中的密码): mysql -u root -p

9.修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
后面的单引号里面是密码。

以上就是Windows下MySQL的安装,如果想要深入学习,推荐《MySQL是怎样运行的》这本书,可以让你从根上理解MySQL。

《MySQL是怎样运行的:从根儿上理解 MySQL》采用诙谐幽默的表达方式,对MySQL的底层运行原理进行了介绍,内容涵盖了使用MySQL的同学在求职面试和工作中常见的一些核心概念。

这本书的作者小孩子 4919在掘金小册上也有发布相关文章哦,有兴趣的同学可以来围观小孩子4919 的个人主页 - 专栏
小孩子4919 的个人主页 - 专栏