1.MySQL Download the operating system corresponding to the MySQL installation package, after decompression can be used directly (free installation).
MySQL installation package, one is the MySQL Enterprise Edition (commercial) Business Edition, there is a community version of MySQL Community Edition (GPL)
I chose the Community Edition installation.
2. The init profile is usually found in the extracted directory, but my
3. Enter MYSQLD to open the server, but some errors may occur,
C:\mysql-5.7.20-win32\bin>mysqld
mysqld:can ' t change dir to ' C:\mysql-5.7.20-win32\data\ ' (Errcode:2-No such file or directory)
at this time we are prompted to add a data file to the MySQL directory to store information.
4. Using mysqld--initialize-insecure
c:\mysql-5.7.20-win32\bin>mysqld--initialize-insecure
c:\mysql-5.7.20-win32\bin>
magical scene: MySQL Performance_schema sys is appearing in the data directory you created ... A number of directories
This is the user's initialization information.
5. Then we are using
C:\mysql-5.7.20-win32\bin>mysqld
You can create a MySQL socket server and the process is in IO blocking state after it is created. Waiting for the client to connect. Then in Task Manager you can see
MySQL server process information, in the details you can see a mysqld.exe process is in use. Because the server is open, java,python,php can be used
their sockets to connect.
6. In the process of opening a CMD to the client connection
because it is initialized, no password can be entered directly
C:\USERS\ADMINISTRATOR>CD C:\mysql-5.7.20-win32\bin
c:\mysql-5.7.20-win32\bin>mysql-u root-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 4
server version:5.7.20 MySQL Community Server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
affiliates. Other names trademarks of their respective
owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
mysql>
7. It's best to configure an environment variable.
Standard-point format:
Mysql:c:\mysql-5.7.20-win32
Path:%mysql%\bin
or directly:
Path:c:\mysql-5.7.20-win32\bin
8. For the sake of convenience:
First, our process can run in the background as a Windows service in Windows. Through
cmd-...--Install to add a Windows service.
make a MySQL Windows service, and if you run mysqld, close it before making it. (It is important to note that when installing Windows services we must run the cmd command prompt with the administrator
otherwise no permissions)
c:\windows\system32>c:\mysql-5.7.20-win32\bin\mysqld--install
Service successfully installed.
c:\windows\system32>
This allows the server (Windows service) to start MySQL in 2 ways.
The first is the use of commands:
net start MySQL
c:\windows\system32>net start MySQL
The MySQL service is starting.
The MySQL service has started successfully.
The second type is:
go to the Task Manager type of service option, find the Windows Service list type of MySQL with the start-up and path and name parameters of the details, and can
you can set the startup mode.
There are also 2 ways of stopping:
net stop MySQL
c:\windows\system32>net stop MySQL
The MySQL service is stopping.
The MySQL service has stopped successfully.
there is more than one
this way, all the installation of MySQL is basically complete.
Summarize the MySQL installation process, and then thank you for some blog.
MySQL installation (more detailed installation steps, including client and server installation, configuration of environment variables, and startup of MySQL using Windows service)