18解压缩版

图片 11

Windows10装置MySQL5.7.18解压缩版

因为是边安装边写,而且MySQL5.7本子及未来安装都挺蛋疼的,所以大概有广大玄学错错误的指导致安装不大概得逞。同理可得请多指教。

安装情况以致软件版本

Windows:Windows10 x64 家庭汉语版

MySQL:Microsoft Windows x86,64-bit zip archive

设置进度

1.下载安装文件

简轻巧单的话就是:登录官方网址()=>Downloads=>Community=>MySQL
Community Server=>Microsoft Windows & Windows(x86,64-bit)=>ZIP
Archive & Download=>No thanks, just start my download.

尔后下载进程就能够起来。

2.最初设置

根据法定的文书档案:

2.3.5 Installing MySQL on Microsoft Windows Using a noinstall Zip Archive

 

2.3.5.1 Extracting the Install
Archive

2.3.5.2 Creating an Option
File

2.3.5.3 Selecting a MySQL Server
Type

2.3.5.4 Initializing the Data
Directory

2.3.5.5 Starting the Server for the First
Time

2.3.5.6 Starting MySQL from the Windows Command
Line

2.3.5.7 Customizing the PATH for MySQL
Tools

2.3.5.8 Starting MySQL as a Windows
Service

2.3.5.9 Testing The MySQL
Installation

Users who are installing from the noinstall package can use the
instructions in this section to manually install MySQL. The process
for installing MySQL from a Zip archive is as follows:

  1. Extract the main archive to the desired install directory

    Optional: also extract the debug-test
    archive if you plan to execute the MySQL benchmark and test
    suite

  2. Create an option file

  3. Choose a MySQL server type

  4. Initialize MySQL

  5. Start the MySQL server

  6. Secure the default user accounts

This process is described in the sections that follow.

 可以知道步骤大约是:

  1. 解压文件到安装目录
  2. 始建布局文件
  3. 挑选安装类型
  4. 初始化MySQL
  5. 启动MySQL服务
  6. 保证客商账户安全

那多少个步骤。看起来挺轻便的,但思念到MySQL的安装有多坑,笔者或然挺慌的。

这就是说,作者也按文书档案一步步安装吧。

1.创办贰个安装目录并将下载好的安装文件解压到目录中

图片 1

如图,然后是解压。

对了,文书档案上有多少个要点要留意下:

2.3.5.1 Extracting the Install Archive

To install MySQL manually, do the following:

  1. If you are upgrading from a previous version please refer
    to Section 2.3.8, “Upgrading MySQL on
    Windows”,
    before beginning the upgrade process.

  2. Make sure that you are logged in as a user with administrator
    privileges.

  3. Choose an installation location. Traditionally, the MySQL server
    is installed in C:mysql. The MySQL Installation Wizard installs
    MySQL under C:Program FilesMySQL. If you do not install MySQL
    at C:mysql, you must specify the path to the install directory
    during startup or in an option file. See Section 2.3.5.2,
    “Creating an Option
    File”.

    Note

    The MySQL Installer installs MySQL under C:Program FilesMySQL.

  4. Extract the install archive to the chosen installation location
    using your preferred Zip archive tool. Some tools may extract the
    archive to a folder within your chosen installation location. If
    this occurs, you can move the contents of the subfolder into the
    chosen installation location.

 注意第2条和第4条,有两点须要留意:

  1. 当前登录顾客必须具备管理员权限
  2. 稍加压缩软件会在解压缩时把结果归入五个目录中方便管理,若是产生这种景况,请将解压缩的源委移动到上一流文件夹中

关于第1条,笔者也不亮堂要怎么确认,走一步算一步吧。而第2条,未来的压缩工具都是那样的哟。同理可得,感谢相告。

图片 2

如图,解压的结果正是这么了。思虑下方才文书档案里说的,姑且把当中的内容移到上风姿罗曼蒂克层目录吧,如图:

图片 3

那正是说开始下一步吧。

2.创建布局文件

依附文书档案内容:

When the MySQL server starts on Windows, it looks for option files in
several locations, such as the Windows directory, C:, and the MySQL
installation directory (for the full list of locations,
see Section 5.2.6, “Using Option
Files”).
The Windows directory typically is named something like C:WINDOWS.
You can determine its exact location from the value of
the WINDIR environment variable using the following command:

C:> echo %WINDIR%

MySQL looks for options in each location first in the my.ini file,
and then in the my.cnf file. However, to avoid confusion, it is best
if you use only one file. If your PC uses a boot loader where C: is
not the boot drive, your only option is to use the my.ini file.
Whichever option file you use, it must be a plain text file.

相似,配置文件my.ini必得放在系统目录中。若是不晓得这些目录地点,能够用 echo %WINDIQX58% 来猎取。如图:

图片 4

能够看出,C:Windows就是那些Windows
Directory。但是,那么些目录里面包车型地铁公文多且杂,而且基本上对于系统很关键,且那么些文件是有访问调整的,作者操心程序会因为权限的原故运转失利。考虑这么些原因,依旧不要把布署文件放入系统目录为好。

这就是说,能够放在其余路线么?让自个儿翻一下文书档案。

On Windows, MySQL programs read startup options from the files shown
in the following table, in the specified order (top files are read
first, files read later take precedence).

Table 5.1 Option Files Read on Windows Systems

File Name Purpose
%PROGRAMDATA%MySQLMySQL Server 5.7my.ini, %PROGRAMDATA%MySQLMySQL Server 5.7my.cnf Global options
%WINDIR%my.ini, %WINDIR%my.cnf Global options
C:my.iniC:my.cnf Global options
BASEDIRmy.ini, BASEDIRmy.cnf Global options
defaults-extra-file The file specified with --defaults-extra-file, if any
%APPDATA%MySQL.mylogin.cnf Login path options (clients only)

 

In the preceding table, %PROGRAMDATA% represents the file system
directory that contains application data for all users on the host.
This path defaults to C:ProgramData on Microsoft Windows Vista and
greater, and C:Documents and SettingsAll UsersApplication Data on
older versions of Microsoft Windows.

%WINDIR% represents the location of your Windows directory. This is
commonly C:WINDOWS. Use the following command to determine its
exact location from the value of the WINDIR environment variable:

C:> echo %WINDIR%

%APPDATA% represents the value of the Windows application data
directory. Use the following command to determine its exact location
from the value of the APPDATA environment variable:

C:> echo %APPDATA%

BASEDIR represents the MySQL base installation directory. When
MySQL 5.7 has been installed using MySQL Installer, this is
typically C:PROGRAMDIRMySQLMySQL 5.7
Server where PROGRAMDIR represents the programs directory
(usually Program Files on English-language versions of Windows),
See Section 2.3.3, “MySQL Installer for
Windows”.

在文档5.2.6 Using Option
Files中,有安插文件的读取顺序。看不懂第一条是如何鬼,不过能够看出第4条是指安装目录。固然事先级不高,然而应当其余目录未有同名的公文就能够卓有功能。

这就是说在设置目录下树立布局文件:

图片 5

在乎文件的编码格式最佳是utf-8无BOM格式。内容如下:

[mysqld]
basedir=D:\webserver\mysql-5.7.18
datadir=D:\webserver\mysql-5.7.18\data
port=3306

只是开行的话那样的内容应该是十足的。

3.挑选MySQL服务类型

实际小编也不懂那些MySQL服务类型指的是何等。存粹是依据 2.3.5.3 Selecting a MySQL Server
Type 文书档案标题直译的。由此可以知道一步步来呢。

看过文书档案,貌似这一步只是广阔,什么都休想做。那么大家没头没脑先导下一步吧。

4.开端化数据库目录文件

这一步十三分要害。相信有Linux或Unix编写翻译安装MySQL经历的都应当有所精晓。总的来讲,这一步用来生成数据库数据文件。

2.3.5.4 Initializing the Data Directory

If you installed MySQL using the Noinstall package, you may need to
initialize the data directory:

  • Windows distributions prior to MySQL 5.7.7 include a data
    directory with a set of preinitialized accounts in
    the mysql database.

  • As of 5.7.7, Windows installation operations performed using
    the Noinstall package do not include a data directory. To
    initialize the data directory, use the instructions
    at Section 2.10.1.1, “Initializing the Data Directory Manually
    Using
    mysqld”.

基于文档所述,在5.7.7原先的Windows发行版都包含了龙腾虎跃度预起初化的数据库文件的,可是之后的版本都要客商手动初叶化。真烦。

据他们说文书档案2.10.1.1 Initializing the Data Directory Manually Using
mysqld上所述,结合本次设置具体情状来看,制定步骤如下:

  1. 以管理员权限运维cmd
  2. 踏入安装目录
  3. 试行早先化命令:mysqld.exe
    –defaults-file=D:webservermysql-5.7.18my.ini
    –initialize-insecure

    • 因为开采了–defaults-file 选项,为了确定保障起见,依然用它钦定了配置文件的职位
    • 选取 –initialize-insecure 并不是–initialize 是因为能够生成二个无密码root账号

下一场等就行了…应该没难题啊。进程如图:

图片 6

啊,对了。有个细节忘记交代。那便是要先创立三个数据库文件夹,然后在安插文件中指明。

本人那边就成立在了设置目录下,如图:

图片 7

本来是个空目录,在举行了早先化之后,里面有了文本,如图:

图片 8

这一步应该算是成功了。

5.第贰回开发银行服务

基于文书档案,说是实行 mysqld.exe
–console 就行了。当然是要在安装目录下。如图:

图片 9

按文书档案上的话应该是如此:

To start the server, enter this command:

C:> "C:Program FilesMySQLMySQL Server 5.7binmysqld" --console

For a server that includes InnoDB support, you should see the
messages similar to those following as it starts (the path names and
sizes may differ):

InnoDB: The first specified datafile c:ibdataibdata1 did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file c:ibdataibdata1 size to 209715200
InnoDB: Database physically writes the file full: wait...
InnoDB: Log file c:iblogsib_logfile0 did not exist: new to be created
InnoDB: Setting log file c:iblogsib_logfile0 size to 31457280
InnoDB: Log file c:iblogsib_logfile1 did not exist: new to be created
InnoDB: Setting log file c:iblogsib_logfile1 size to 31457280
InnoDB: Log file c:iblogsib_logfile2 did not exist: new to be created
InnoDB: Setting log file c:iblogsib_logfile2 size to 31457280
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: creating foreign key constraint system tables
InnoDB: foreign key constraint system tables created
011024 10:58:25  InnoDB: Started

When the server finishes its startup sequence, you should see
something like this, which indicates that the server is ready to
service client connections:

mysqld: ready for connections
Version: '5.7.19'  socket: ''  port: 3306

The server continues to write to the console any further diagnostic
output it produces. You can open a new console window in which to run
client programs.

然则,笔者那边是这么的:

图片 10

不领悟这是…但姑且乐观得以为成功了吗。下一步,下一步。

6.由此命令行运维MySQL

经过参考文书档案,步骤如下:

  1. 打开cmd
  2. 进去安装目录下的bin目录
  3. 输入指令mysql.exe -u root

因为初始化参数的涉及,root账户尚未密码。进程如图:

图片 11

到这一步能够说是ok了。

关于第第5步的玄学报错,实在无心去查文书档案了,要是哪位读者领会的话还望不吝指教,不胜感谢。

总结

1.开发银行和关闭服务的议程

运维是在装置目录的bin目录下奉行 mysqld.exe
–defaults-file=D:webservermysql-5.7.18my.ini ,关闭的话须要实践 mysqladmin -u root shutdown 。

2.安顿文件

小编的配备文件独有4行,肯定是相当不够的,但只是简简单单利用的话也没难点。不问可见不在那扩大了,现在在说吗。

Leave a Comment.