MySQL是一个开放源代码的数据库管理系统,是由MySQL AB公司开发、发布并支持的,现在属于Oracle旗下产品。
与其他大型数据库管理系统如Oracle、DB2、SQL Server等相比,虽然MySQL规模小、功能有限,但是具有跨平台、体积小、速度快、成本低等优点,是最受欢迎的关系型数据库管理系统之一。
安装程序的下载
首先打开mysql官方网站https://www.mysql.com/,点击DOWNLOADS->Community->MySQL on Windows。

点击“MySQL Installer”:

点击MySQL Server:

点击右侧的“MySQL Community Server 5.7”:

点击Windows(x86,32&64bit),MySQL Installer MSI:

点击“Download”,只有32位安装文件,但是页面中央写明了:Note: MySQL Installer is 32 bit, but will install both 32 bit and 64 bit binaries.所以下载这个就可以了。

点击“No thanks, just start my download.”即可开始下载安装文件。

MySQL安装
双击安装程序进行安装,勾选“I accept the license terms”。

点击“Next”:

此时有五个选项:默认开发版(Developer Default)、只安装数据库服务(Server only)、只安装客户端(Client only)、完全版(full)、和自定义版(Custom),我们选择Custom,点击“Next”:

点击MySQL Servers前面的“+”,依次展开将MySQL Server 5.7.24-x64添加到右侧,点击“Next“。

点击“Execute”:

然后点击“Next”:

点击“Next”:

此处就选择第一个,独立运行MySQL Server,下面的选项是在沙箱运行,点击“Next”:

这里服务端口等就选择默认就可以了,点击“Next”:

此处填写数据库root根用户密码,一定要记住密码,点击下面MySQL User Accounts的“Add User”,也可以添加用户账户,此处先不做添加以后开发使用时再添加即可,点击“Next”:

服务名称和开机启动等默认安装即可,点击“Next”:

点击“Next”:

点击“Execute”,进行安装:

等待过程完成:

点击“Finish”:

点击“Next”:

点击“Finish”,完成安装。
配置环境变量
右键点击桌面上此电脑,点击属性,打开属性界面。

点击高级系统设置:

点击环境变量:

此处“有用户变量”和“环境变量”,在任意一处进行配置都可以,仍然选择在用户变量中进行配置,点击选中path。

点击“新建”按钮,在下面的输入框中输入C:\Program Files\MySQL\MySQL Server 5.7\bin。

点击“确定”,这样在控制台中的任意路径下都可以使用mysql命令而不需要先进入MySQL的安装路径了。
检验配置是否成功
按“win”键+字母“R”,输入cmd,打开命令提示符:

在命令提示符中输入:mysql -uroot -p密码:

进入MySQL命令行:

配置成功。
网友评论