WIN10 installing MySQL

Source: Internet
Author: User
Tags mysql client administrator password

Reference: Win 10 installing MySQL 5.7

Website: http://blog.sina.com.cn/s/blog_5f39af320102wbk0.html

This article refers to the tutorial on the URL above, thanks to the author for sharing.

I installed the decompression version, because the installation version is not 64-bit, and the installation version is automatically installed, saving a part of the configuration operation,

Anyway is learning, on their own to install the decompression version of the 64-bit.

I'll explain the steps below:

1, download, to MySQL official website: http://dev.mysql.com/

Click Downloads=>community=>mysql Community Server

The selected version starts the download.

2. Unpack the installation package

Unzip the downloaded installation package, put it on your computer path, I placed the E:\mysql

3. Configuring the My.ini File

After extracting the root directory, there is a My-default.ini file, which is the official profile sample version,

We'll make a copy of this file in the same directory, with the name changed to My.ini.

Use TXT to open the editor, the original description content empty, modified as follows: (again, this is copied from the reference site)

[MySQL]

; Set the MySQL client default character set

Default-character-set=utf8

[Mysqld]

; Set Port 3306

Port = 3306

; Set up the installation directory for MySQL

basedir=e:\mysql5.7

; Set up the data storage directory for the MySQL database

Datadir=e:\mysql5.7\data

; Maximum number of connections allowed

max_connections=200

; The character set used by the service side defaults to the 8-bit encoded latin1 character set

Character-set-server=utf8

; Default storage engine that will be used when creating a new table

Default-storage-engine=innodb

After modifying, save exit.

4. Install MySQL

Open the CMD window as an administrator, to C:\windows\system32\cmd.exe to find the CMD program, (The following all CMD command operation, preferably open as an administrator)

by E:

CD MySQL

CD bin

These three steps go into the MySQL bin directory,

Input command: mysqld Install

After waiting for the prompt to install successfully,

Input command: mysqld--initialize, this step is used to initialize the data directory, the official compression package decompression and no Data folder, after running the command, automatically generate the data folder under the root directory

Finally, enter the command: net start MySQL, start the service.

5. Set the root administrator password

The new version of the Mysql,root user's password can not be empty, at this time, our root is no password, so we need to set.

Win+r, enter services.msc, open the service, find the MySQL service, close it.

Then open cmd and enter the command:

E:

CD MySQL

CD bin

Mysqld--defaults-file= "E:\mysql\my.ini"--console--skip-grant-tables

This is the safe mode of turning on MySQL. (This cmd does not close)

In addition, open a CMD and enter the command:

E:

CD MySQL

CD bin

Mysql-u root-p

At this point, cmd displays the Enter password:

Hit the enter key directly to successfully enter MySQL

Enter the SQL statement as follows:

Use MySQL; Show Database changed

Update user set Authentication_string=password ("123") where user= "root"; Display: Query ok,1 rows Affected (0.01 sec) rows matched:1 changed:1 warnings:1

Flush privileges; Display: Query ok,0 rows Affected (0.00 sec)

Quit

Complete so that the root user's password is set to 123.

Finally, in order to facilitate the start of MySQL later, configure environment variables

Path append:; E:\mysql\bin;

Complete, the next way to run MySQL is to open cmd, enter the command:

Mysql-u root-p

123

You can do it.

6, after the first run, set common parameters:

1) After login, it is necessary to set the root user's password in normal mode, enter: Set Password=password (' 123 ');

2) Open the full permissions of the root operation database:

Use MySQL;

Show tables;

Select Host,user from user;

Update user set host= '% ' where user= ' root ';

Quit

net stop MySQL

net start MySQL

Complete.

MySQL is fully installed and ready to use. (If the intermediate service is turned off without prompting it, start it yourself)

WIN10 installing MySQL

Related Article

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.