像MySQL这样的数据库配置起来很复杂。你需要按照下列步骤在Windows上安装和配置MySQL。
步骤
{"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
以系统管理员身份登录计算机。 你将获得管理员权限,这会让安装过程顺利一些。需要注意的是,安装完成以后,并不需要管理员权限运行程序。
{"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 。
{"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格式,双击它会启动计算机上的解压程序,让你进入安装程序文件夹。
{"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。 (该文件应该是文件夹中唯一的文件。)启动安装程序。
{"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
点击下一步。 开始安装。
{"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即将开始安装了。
{"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
点击安装。 等待程序运行。
{"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 的提示窗口。你现在可以跳过,因为以后可以随时注册。当你跳过注册后,会看到一个新的对话框显示安装向导结束 。
{"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服务器,然后点击 完成 。
{"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
点击下一步。 开始配置数据库服务器。
{"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
选择标准配置,然后点击下一步。 建议大部分用户选择默认的标准配置。
{"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服务器复选框,然后点击下一步。
{"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
创建根密码。 你可以输入自己的根密码,并确认选中允许远程登录根用户 复选框。记得选择不容易猜到的复杂密码,并将密码'记下来 以防自己忘记。点击下一步 。
{"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完成工作后,点击结束 。
{"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。 该命令将打开一个命令行窗口,并要求你输入密码。
{"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。