MySQL-8.0 Installation Tutorial under Win10

Source: Internet
Author: User

Download

MySQL8.0 for Windows Zip package: https://dev.mysql.com/downloads/file/?id=476233.

After entering the page can not login, click on the bottom "No thanks, just start my download." To start the download.

Or you can download it directly: Https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip.

Installation 1. Unzip the package to the installation directory

My installation directory is: D:\Programmer\mysql, extract the results as follows

2. Modify the configuration file

In Windows systems, the configuration file defaults to the My.ini file (or My-default.ini) in the installation directory, and some configurations need to be configured during initial installation, and most can be changed after the installation is complete.

Discover that the extracted directory does not have a My.ini file, it's OK to create it yourself. Add My.ini at the root of the installation, for example I am here: D:\Programmer\mysql\mysql-8.0.11-winx64, write the basic configuration:

[mysqld]# Set 3306 ports Port=3306# Set up the MySQL installation directory Basedir=D:\Programmer\mysql\mysql-8.0. One-winx64# Set the data storage directory for the MySQL database DataDir=D:\Programmer\mysql\mysql-8.0. One-winx64\data# Maximum number of connections allowed Max_connections= $# Number of attempts to allow connection failures. This is to prevent someone from attempting to attack the database system from the host Max_connect_errors=Ten# The default character set used by the server is UTF8character-Set-Server=utf8# default storage engine to use when creating a new tabledefault-Storage-Engine=innodb# default to use "Mysql_native_password" Plugin authentication default_authentication_plugin=Mysql_native_password[MySQL]# Set the MySQL client default character setdefault-character-Set=UTF8[Client]# The port that is used by default when MySQL client connects to server port is set=3306default-character-Set=Utf8

Note that the inside of the Basedir is my local installation directory, DataDir is the location of my database data files to be stored (not created in Data folder, the program is automatically created when installed), the configuration needs to be configured according to their own environment.

To view all the configuration items, refer to: https://dev.mysql.com/doc/refman/8.0/en/mysqld-option-tables.html

3. Initialize the database

Open the CMD Command Line window as an administrator and go to the bin directory under MySQL's installation directory to execute the following command:

Mysqld--initialize--console

After execution, the root user's initial password is printed and the result is as follows:

 c:\windows\system32>d:d:\  >cd Programmer\mysql\mysql-8.0.11-winx64\bind:\programmer\mysql\mysql  -8.0.11-winx64\bin>mysqld--initialize--< Span style= "COLOR: #000000" >console  2018-07-30t14:17:46.332533z 0 [System] [MY-013169] [Server] D:\Programmer\ Mysql\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server in  Progress as process  26282018-07-30t14:17:57.499721z 5 [Note] [MY-010454] [ Server] A temporary password is generated for  [Email protected]localhost:; y;2v,aseo<q  2018-07-30t14:18:04.761500z 0 [System] [MY-013170] [Server] D:\ Programmer\mysql\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of Server has completedd:\programmer\mysql\mysql  -8.0.11-winx64\bin> 

Attention! There is a paragraph in the execution output:

[Note] [MY-010454] [Server] A temporary password is generated for [email protected]:; y;2v,aseo<q

where [email protected]: the following "; Y;2v,aseo<q" is the initial password (excluding the first space). Before changing the password, you need to remember this password, subsequent logins need to use.

If your hands are cheap, close quickly, or don't remember, that's fine, delete the initialized DataDir directory, and then execute the initialization command again, and regenerate it. Of course, you can also use security tools, forced to change the password, with what method, their own discretion.

Reference: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization-mysqld.html

4. Installation Services

Continue to execute commands in the bin directory of the MySQL installation directory

mysqld--install [service name]

After the service name can not be written, the default name is MySQL. Of course, if you need to install more than one MySQL service on your computer, you can differentiate it with different names, such as MySQL5 and Mysql8.

After the installation is complete, you can start the MySQL service with the following command.

net start MySQL

Examples of execution results:

D:\programmer\mysql\mysql-8.0.11-winx64\bin>mysqld--installservice successfully installed. D:\Programmer\mysql\mysql-8.0.11-winx64\bin>net start Mysqlmysql service is starting. The MySQL service has started successfully. 

Reference: https://dev.mysql.com/doc/refman/8.0/en/windows-start-service.html

Change Password

Execute the command in the bin directory of the MySQL installation directory:

Mysql-u root-p

This time you will be prompted to enter a password, remember the above installation of the initial password, fill in to log in successfully, into the MySQL command mode.

Prior to MySQL8.0.4, the execution

SET PASSWORD=PASSWORD ('[modified password]');

You can change the password, but starting with MySQL8.0.4, it doesn't work by default. Because before, MySQL's password Authentication plug-in is "Mysql_native_password", and now uses "Caching_sha2_password". Because there are many database Tools and link packages do not support "Caching_sha2_password", for convenience, I temporarily changed back to the "Mysql_native_password" Authentication plugin.

Modify the password verification plugin and change the password at the same time. Execute the command in MySQL:

ALTER USER ' Root '@'localhost'with by' new password ' ;

If you want to use the Mysql_native_password plug-in authentication by default, you can configure the Default_authentication_plugin entry in the configuration file.

Add the following in the configuration file My.ini:

[mysqld] Default_authentication_plugin =Mysql_native_password

The following example is shown in this step:

D:\programmer\mysql\mysql-8.0.11-winx64\bin>mysql-u Root-penter Password:************Welcome to the MySQL Monitor. CommandsEndWith , or \g.your MySQL connection ID is8Server Version:8.0.11Copyright (c)2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type ' help; ' or ' \h ' forHelp . Type ' \c ' to clear the current input Statement.mysql> ALTER USER ' root ' @ ' localhost ' identified with Mysql_native_password by ' 123456789'; Query OK,0 rows affected (0.12 sec)

Reference: Https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password

Here, the installation deployment is complete.

Finally, you can close the database by using the following command:

net stop MySQL

Examples are as follows:

mysql> exitbyed:\programmer\mysql\mysql-8.0.11-winx64\bin>net stop mysqlmysql service is stopping. The MySQL service has stopped successfully. D:\Programmer\mysql\mysql-8.0.11-winx64\bin>

MySQL-8.0 Installation Tutorial under Win10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.