MySQL5.7 installation under Windows

Source: Internet
Author: User

This article explains installing MySQL from a compressed package.

1. Download the MySQL compression pack, "Windows (x86, 64-bit), ZIP Archive";

2. Unzip the zip package to the desired directory, such as D:\mysql-5.7.18-winx64;

3. Create the My.ini file with the following content:

[mysqld]   port=3306  basedir=d:\\mysql-5.7.  -winx64\datadir=f:\\mysqldata\\
Character-set-server=utf8

Note that Basedir and DataDir are required to be configured, and Basedir is the directory you unzipped. The official document says that if you like to use a slash, you use a double slash, and you don't have to do that with a backslash. i.e.: d:\\mysql-5.7.13-winx64\\ or: d:/mysql-5.7.13-winx64/
Because I like to separate the data files of the database, so the DataDir configuration to other places, easy to manage.

4. Configure Environment variables

Add a variable called Mysql_home.
Modify the path variable and add%mysql_home%\bin at the end

5. Initializing and starting the MySQL service

Run cmd with administrator privileges, initialize MySQL, execute

-- initialize-insecure

Register MySQL service, start MySQL, execute

- installnet start MySQL

6. Log in to MySQL and set the root password

- -P

First login without password direct enter login, log in MySQL, set the root password

ALTER USER ' Root '@ 'localhost'by'mynewpass4! ';

After changing the password, we can log in successfully using root.

MySQL5.7 installation under Windows

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.