MySQL Installation configuration tutorial

Source: Internet
Author: User

1. Download

Http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-winx64.zip


2. Unzip the ZIP package;

D:\Program files\mysql-5.7.11-winx64


3. Configure Environment variables

3.1 Add path Path

D:\Program Files\mysql-5.7.11-winx64\bin


3.2. Modify the Mysql-default.ini configuration file

Original

# These is commonly set, remove the # and set as required.

# Basedir = ...

# DataDir = ...

# port = .....

# server_id = ...

Switch

# These is commonly set, remove the # and set as required.

basedir = D:\Program files\mysql-5.7.11-winx64

DataDir = D:\Program Files\mysql-5.7.11-winx64\data

Port = 3306

# server_id = ...


4. Enter command prompt cmd as administrator and go to the MySQL bin directory

D:\Program files\mysql-5.7.11-winx64\bin>


5. Execute mysqld--initialize-insecure command to create the data directory

D:\Program Files\mysql-5.7.11-winx64\bin>mysqld--initialize-insecure

Note: The mysqld--initialize command will generate a random password for the root user.


6. Execute the mysqld-install command, install the service

D:\Program Files\mysql-5.7.11-winx64\bin>mysqld-install


7, open with Safe mode, execute Mysqld.exe-nt--skip-grant-tables, this time, the cursor will always blink. Note, do not move, open another command-line window.

D:\Program files\mysql-5.7.11-winx64\bin>mysqld.exe-nt--skip-grant-tables


8. Reopen the DOS window and execute mysql-u root-p

D:\Program Files\mysql-5.7.11-winx64\bin>mysql-u Root-p

The password is empty, the direct carriage returns, then can go in, then executes:

Mysql>update User Set Authentication_string=password ("123456") where user= "root";

Mysql>flush privileges;


Exit and log in again.

Mysql> ALTER USER ' root ' @ ' localhost ' identified by ' new_password ';


Note: If Windows fails to start the MySQL service (located on the local computer). Error 2: The system cannot find the file specified. "Error, because: previously installed MySQL, uninstall after reinstalling directory inconsistency caused.

Workaround:

Open the Regedit registry and locate the Heky_local_mechine->system->currentcontrolset->servers->mysql->imagepath modified to the installation directory: "D:\Program files\mysql-5.7.11-winx64\bin\mysqld" MySQL

At this time to start the MySQL service, there is no problem.


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



This article from "It Technology Learning and communication" blog, declined reprint!

MySQL Installation configuration tutorial

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.