怎么在Windows上安装MySQL数据库服务器

像MySQL这样的数据库配置起来很复杂。你需要按照下列步骤在Windows上安装和配置MySQL。

步骤

  1. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/2\/28\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-1-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-1-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/2\/28\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-1-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-1-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 1 以系统管理员身份登录计算机。你将获得管理员权限,这会让安装过程顺利一些。需要注意的是,安装完成以后,并不需要管理员权限运行程序。
  2. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/e\/e9\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-2-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-2-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/e\/e9\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-2-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-2-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 2 下载免费的MySQL服务器社区版。下载包含有Windows安装程序的版本,然后将文件存放在Windows桌面上。
    • 如果你不知道应该选择哪个版本,可以下载MySQL Installer for Windows
  3. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/7e\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-3-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-3-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/7e\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-3-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-3-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 3 双击下载的文件。下载的安装文件是.zip格式,双击它会启动计算机上的解压程序,让你进入安装程序文件夹。
  4. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/8\/83\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-4-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-4-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/8\/83\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-4-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-4-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 4 双击Setup.exe。(该文件应该是文件夹中唯一的文件。)启动安装程序。
  5. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/57\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-5-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-5-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/57\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-5-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-5-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 5 点击下一步。开始安装。
  6. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/78\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-6-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-6-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/78\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-6-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-6-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 6 点击自定义 > 下一步。你可以选择将MySQL安装到什么位置。如果你的Apache安装在C:\Server目录下,那么你可以将MySQL安装在同一个目录下。
    • 在下一个窗口中选中MySQL服务器,然后点击更改
    • 在下一个窗口中,在文本框文件夹名中,将目录更改为C:\Server\MySQL\,然后点击确定
    • 在下一个窗口中,点击下一步。现在MySQL即将开始安装了。
  7. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/3\/36\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-7-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-7-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/3\/36\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-7-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-7-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 7 点击安装。等待程序运行。
  8. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/59\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-8-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-8-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/59\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-8-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-8-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 8 选择跳过注册,然后点击下一步。当安装结束后,你将看到注册MySQL的提示窗口。你现在可以跳过,因为以后可以随时注册。当你跳过注册后,会看到一个新的对话框显示安装向导结束
  9. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/a0\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-9.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-9.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/a0\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-9.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-9.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 9 配置MySQL。选中复选框'马上配置MySQL服务器,然后点击完成
  10. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/6\/6d\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-10-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-10-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/6\/6d\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-10-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-10-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 10 点击下一步。开始配置数据库服务器。
  11. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/2\/22\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-11-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-11-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/2\/22\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-11-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-11-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 11 选择标准配置,然后点击下一步。建议大部分用户选择默认的标准配置。
  12. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/01\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-12-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-12-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/01\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-12-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-12-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 12 确认选中作为Windows服务安装和开机时启动MysQL服务器复选框,然后点击下一步。
  13. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/51\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-13-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-13-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/51\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-13-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-13-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 13 创建根密码。你可以输入自己的根密码,并确认选中允许远程登录根用户复选框。记得选择不容易猜到的复杂密码,并将密码'记下来以防自己忘记。点击下一步
  14. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/a9\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-14-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-14-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/a9\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-14-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-14-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 14 点击运行。启动MySQL服务器。在MySQL完成工作后,点击结束
  15. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/2\/27\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-15-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-15-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/2\/27\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-15-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-15-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 15 在Windows任务栏上,点击开始 > 全部程序 > MySQL > MySQL Server 4.x > MySQL Command line client。该命令将打开一个命令行窗口,并要求你输入密码。
  16. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/a3\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-16-Version-2.jpg\/v4-460px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-16-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/a3\/Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-16-Version-2.jpg\/v4-728px-Install-the-MySQL-Database-Server-on-Your-Windows-PC-Step-16-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 16 输入你的根密码后回车。运行程序。

小提示

  • MySQL支持的Windows版本包括:Windows Server 2003、Windows Server 2008、Windows XP、Windows Vista和Windows 7。
  • 如果你需要同时安装Apache、PHP和MySQL,你可以下载XAMPP软件包,它包含有Apache、MySQL、PHP + PEAR、Perl、mod_php、mod_perl、mod_ssl、OpenSSL、phpMyAdmin、Webalizer、Mercury Mail Transport System for Win32 and NetWare Systems v3.32、JpGraph、FileZilla FTP Server、mcrypt、eAccelerator、SQLite以及WEB-DAV + mod_auth_mysql。

<<:  怎么成为知识渊博的人

>>:  怎么和喜欢的女孩搭讪

怎么照顾一只受伤的蜜蜂

你发现了一只蜜蜂,它正在颤抖、行动迟缓或者已经奄奄一息。你可能会想:“我应该救救它”。幸运的是,的确...

怎么将两台电视连接到Xbox上

如果你有一台Xbox 360或Xbox One主机,不用电缆分路器也可以将两台电视作为显示器。这些方...

怎么冷藏欧芹

将新鲜的欧芹在长势最好的时候冷藏起来,你就能常年吃到新鲜的欧芹了。欧芹可以整束放在冷冻袋里冷藏,也可...

怎么给一个难剥皮的硬鸡蛋剥壳

有时硬鸡蛋很难剥皮。如果《如何剥鸡蛋》中描述的正常方法行不通的话,那么你可能需要采取以下方法。用了这...

怎么在Instagram上使用模糊特效

这篇文章将教你如何使用Instagram程序的移轴滤镜,给照片增加模糊特效。 步骤 {"smallU...