![7780525545c10f9087edf01e9e0e5195.png](https://img-blog.csdnimg.cn/img_convert/7780525545c10f9087edf01e9e0e5195.png)
如何安装数据库?
MySQL数据库用于存放数据,客户端navicat是为了方便操作数据库而设计的一种图形化软件。
只要电脑上安装了客户端,在任何地方打开电脑,都可以使用客户端连接到MySQL数据库。
(1)数据库如何安装?
①从网盘下载MySQL,(链接:https://pan.baidu.com/s/1J5h7G_mBJEA_qGu2Fumdcw
提取码:d5zl);
②安装MySQL:
勾选同意协议,下一步;
![a28f3d63f0c2dee532350ab017d2380d.png](https://img-blog.csdnimg.cn/img_convert/a28f3d63f0c2dee532350ab017d2380d.png)
选择安装类型,选Server only(只安装MySQL),下一步;
![647c5360fa88df0598b3117cc80992d9.png](https://img-blog.csdnimg.cn/img_convert/647c5360fa88df0598b3117cc80992d9.png)
下一步;
![4792ebbe7238ed7f88523c9fe3f09cee.png](https://img-blog.csdnimg.cn/img_convert/4792ebbe7238ed7f88523c9fe3f09cee.png)
点击Execute开始安装;
![6fe86e9ec42364f5b8cae5dc47990343.png](https://img-blog.csdnimg.cn/img_convert/6fe86e9ec42364f5b8cae5dc47990343.png)
下一步;
![f2aa554c729357d3432f9858dd52d22b.png](https://img-blog.csdnimg.cn/img_convert/f2aa554c729357d3432f9858dd52d22b.png)
下一步;
![cdc19ff09e768da111ec3d1b8c0f50c6.png](https://img-blog.csdnimg.cn/img_convert/cdc19ff09e768da111ec3d1b8c0f50c6.png)
默认选第一个,下一步;
![50593d8a0b0f2474f681d84318574b91.png](https://img-blog.csdnimg.cn/img_convert/50593d8a0b0f2474f681d84318574b91.png)
默认,下一步;
![33fa22af42286d3f40f4c8cf9110221f.png](https://img-blog.csdnimg.cn/img_convert/33fa22af42286d3f40f4c8cf9110221f.png)
密码验证方式(Authentication Method)这一步很重要!!!
第一个是强密码校验,MySQL推荐使用最新的数据库和相关客户端,MySQL8换了加密插件,所以如果选第一种方式,很可能你的navicat等客户端连不上MySQL8;
所以这里一定要选第二个(下图红框的地方),因为后面使用客户端navicat,它连接MySQL数据库用的就是这个加密算法,所以这一步很重要!!!
选完,下一步;
![c670bf9a33f7b5c7ab598ad3de85589b.png](https://img-blog.csdnimg.cn/img_convert/c670bf9a33f7b5c7ab598ad3de85589b.png)
设置密码,输入密码,再次输入密码;密码要记住,后面要用密码连接数据库。输入完,下一步;
![c4f6d6dda0f01c9b34f9432ef07ecaa4.png](https://img-blog.csdnimg.cn/img_convert/c4f6d6dda0f01c9b34f9432ef07ecaa4.png)
默认,如果下图名称的地方出现警告,表示名称重复了,需要换个其他名称。下一步;
![2155ebe717a8dacd995ab53b2aae6475.png](https://img-blog.csdnimg.cn/img_convert/2155ebe717a8dacd995ab53b2aae6475.png)
按下图红框的地方勾选,下一步;
![04985b6da3b38268d3dea00337ff66c7.png](https://img-blog.csdnimg.cn/img_convert/04985b6da3b38268d3dea00337ff66c7.png)
点击Execute,安装;
![b6c2c5842c9bddb779f2464730894f24.png](https://img-blog.csdnimg.cn/img_convert/b6c2c5842c9bddb779f2464730894f24.png)
点击Finish;
![15c19b140fd74b4cc972a6a7043c0da7.png](https://img-blog.csdnimg.cn/img_convert/15c19b140fd74b4cc972a6a7043c0da7.png)
默认,点击Finish。
![da895ed8dd67cac3a34492afe2e0d255.png](https://img-blog.csdnimg.cn/img_convert/da895ed8dd67cac3a34492afe2e0d255.png)
③验证是否安装成功;
从开始菜单中打开刚刚安装的MySQL命令行客户端;
![8ae4576d08d5661de2343fd230f4f176.png](https://img-blog.csdnimg.cn/img_convert/8ae4576d08d5661de2343fd230f4f176.png)
输入密码,按Enter;
![a28a91a5c2e291557a222c84359d852f.png](https://img-blog.csdnimg.cn/img_convert/a28a91a5c2e291557a222c84359d852f.png)
如果显示出下面红框内容表示安装成功,红框的是MySQL数据库版本号。
![30ae7eef3b700876bd4a2ee8d9d1526d.png](https://img-blog.csdnimg.cn/img_convert/30ae7eef3b700876bd4a2ee8d9d1526d.png)
(2)客户端如何安装?
从网盘下载和安装客户端navicat;
![fc96db008d45a73c8690b2d5c834f961.png](https://img-blog.csdnimg.cn/img_convert/fc96db008d45a73c8690b2d5c834f961.png)
打开客户端;
![b491897c2f12844b1b2f33dca5db9f76.png](https://img-blog.csdnimg.cn/img_convert/b491897c2f12844b1b2f33dca5db9f76.png)
设置连接属性,左上角点击“连接-MySQL”;
![1f0dac3dd41709605a0406c5d1ade689.png](https://img-blog.csdnimg.cn/img_convert/1f0dac3dd41709605a0406c5d1ade689.png)
弹出连接属性的提示框,填写信息,点击“连接测试”,测试是否连上了数据库;
![71c099541454ee97a67b95ba296580bd.png](https://img-blog.csdnimg.cn/img_convert/71c099541454ee97a67b95ba296580bd.png)
连接名:随意起一个名字
主机名货IP地址:localhost(表示MySQL数据库在本地)
端口:默认是3306
用户名和密码:输入安装MySQL数据库时设置的用户名和密码
在实际的业务中,数据库服务器不在你的电脑上上,这时候提供数据库的人会告诉你上图要填的信息。
提示“连接成功”,说明连接属性设置正确,可以连上mysql数据库,再点击“确定”;
![4357099e62a076654b7b9a79d16bcd72.png](https://img-blog.csdnimg.cn/img_convert/4357099e62a076654b7b9a79d16bcd72.png)
查看数据库,连接成功后,在左侧的导航窗口按右键,点击“打开连接”;
![e921484b6efa644836b59fb9dcfce0a8.png](https://img-blog.csdnimg.cn/img_convert/e921484b6efa644836b59fb9dcfce0a8.png)
会看到MySQL数据库里所有的数据库,不同版本的MySQL数据库里的内容可能不一样;
![503d07db6a2920d9a90628809a6d3021.png](https://img-blog.csdnimg.cn/img_convert/503d07db6a2920d9a90628809a6d3021.png)
之后会继续学习如何使用navicat来操作数据库和写sql,欢迎关注~