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

Source: Internet
Author: User

Catalogue
    • 1. Download MySQL5.7.18 Green Edition
      • 1.1 Download links
    • 2. Create or empty the Data folder
    • 3. Installation Services
      • 3.1 Open cmd (admin)
      • 3.3 Installation Services
    • 4. Initializing the database
    • 5 Starting the Service
    • 6. Client-side testing
    • 7. Configure the encoding to UTF-8
    • 8. Change the password
    • 9. Re-open MySQL

Body

Back to top 1. Download MySQL5.7.18 green version back to top 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 back to top 1.2 unzip

Extract to Folder

Back to top 2. Create new or empty Data folder 2.1 after extracting, creating a Data folder in the directory

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

Back to top 3. Installation Services

Back to top 3.1 open cmd (admin)

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

3.2 Open the Bin folder of MySQL in cmd

Back to top 3.3 installation Services 3.3.1 Run 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

Back to top 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).

Back to top 5 start service

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

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

Back to top 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.

Back to top 7. Configure Encoding to UTF-8

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

Add the following code to the My.ini

[Mysqld]character-set-server=utf8[mysql]default-character-set=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%‘;(修改前)

7.2.3 View encoding Commands:show variables like ‘character%‘;(修改后)

Back to top 8. Change Password

Gradually enter the following code in MySQL:



Quit MySQL
Quit

A.

B.

C.

D.

Back to top 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.