怎么在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。

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

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

怎么计算圆的周长

不管你是在做手工艺品,还是给热水浴池装围栏,或者只是为了完成学校布置的数学作业,要解决一切与圆相关的...

怎么修复神经损伤

自体免疫疾病、运动神经元病、癌症、感染和糖尿病都有可能引起神经损伤。神经也有可能因为急性或进行性损害...

怎么写信申请成为志愿者

志愿服务是把自己的时间和服务奉献给其他的人或者组织,但并不期望得到金钱回报的一类活动。首先你要选择一...

怎么一天喝足八杯水

水乃生命之源,帮助我们远离脱水之余还能将身体里的毒素通通排出,维持身体的正常运转。近年来,研究人员和...

怎么更改Wi Fi密码

Wi-Fi的存在极大程度上便利了我们与世界的联系,不过不安全的Wi-Fi密码会有泄露个人资料的风险。...