MySQL5.7 initialization and Change password for green version (free version)

Source: Internet
Author: User
Tags mysql in

1. Download MySQL5.7.18 Green version 1.1 download link

The following is a MySQL5.7.18 green version of the link (source Oracle website), open the link directly to download

Https://dev.mysql.com/gt/Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip 1.2 Decompression

Extract to Folder

2. New or empty Data folder 2.1 Unzip, create a data folder under the directory

2.2 If you already have a data folder, you can delete all of it.

3. Installation Services

3.1 Open cmd (admin)

Right-click Start menu → select command Prompt (Admin)

3.2 Open the Bin folder of MySQL in cmd

3.3 Installation Services 3.3.1 Run the command mysqld–install installation services, such as:

3.3.2 (can be ignored) if you do not need MySQL, only need to run mysqld–remove can be removed, such as

4. Initializing the database

4.1 Run command: mysqld--initialize-insecure--user=mysql--explicit_defaults_for_timestamp.

Before running, make sure that there are no files in the data directory (initialization fails if there is a file).

5 Starting the Service

5.1 Run the net start MySQL startup service, such as:

5.2 Run the net stop MySQL startup service, such as:

6.Client Testing

6.1 Run: Mysql–uroot–p

Such as:

You don't need a password here, just press ENTER

Seeing Mysql> proves to be a successful entry into MySQL.

7. Configure the encoding to UTF-8

7.1 Create a. txt file and rename it to My.ini

Add the following code to the My.ini

[client] default - character - Set =  [mysqld]character-set- Server=UTF8

7.2 Viewing the encoding in MySQL

7.2.1 restart MySQL, command:mysqld restart

7.2.2 View encoding Commands:show variables like ‘character%‘;

8. Change the password

Gradually enter the following code in MySQL:

 Use MySQL; // Password is 123456 Update User set authentication_string=PASSWORD ("123456whereuser= "root"; //  Privileges

Quit MySQL
Quit

A.

B.

C.

D.

9. Re-open MySQL

Sign in with the password you just set 123456

Login Success!!!

This note only records the MySQL5.7 later version should, the version of the command before 5.7 may be a little different oh ~ ~ ~

MySQL5.7 initialization and Change password for green version (free version)

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.