MySQL 5.7.17 winx64 installation and configuration graphic tutorial

MySQL 5.7.17 winx64 installation and configuration graphic tutorial

I summarized the previous notes on installing MySQL and shared them with you.

Step 1: Download the unzipped version of mysql-5.7.17-winx64: http://dev.mysql.com/downloads/mysql/

Step 2: Unzip to the installation directory, such as: C:\myprogram\mysql-5.7.17-winx64

Step 3: Set environment variables

The operation is as follows:

1) Right-click My Computer -> Properties -> Advanced System Settings (Advanced) -> Environment Variables
Click the New button under System Variables
Enter the variable name: MYSQL_HOME
Enter variable value: C:\myprogram\mysql-5.7.17-winx64

2) Select Path in the system variables
Click the Edit button
Add the variable value in the variable value: %MYSQL_HOME%\bin
Note that this variable is added after the original variable value, separated by ;. The original variable value cannot be deleted.

Step 4: Modify the my.ini file in the C:\myprogram\mysql-5.7.17-winx64 folder. If it does not exist, you can copy my-default.ini to modify it:

#########################################################
 [client]
 port=3306
 default-character-set=utf8
 [mysqld]
 port=3306
 character_set_server=utf8
 basedir=%MYSQL_HOME%
 #Unzip directory datadir=%MYSQL_HOME%\data
 #Unzip the data directory in the directory sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 [WinMySQLAdmin]
 %MYSQL_HOME%\bin\mysqld.exe
########

Step 5: Register MySQL as a Windows system service

1) Run cmd as an administrator and enter the bin directory under the MySQL decompression directory from the console:

2) Enter the service installation command:

mysqld install MySQL --defaults-file="%MYSQL_HOME%\my.ini"
#Unzip the modified my.ini file in the directory
After the installation is successful, a message will pop up saying that the service has been successfully installed.
#Note: The my.ini file is placed in the root directory after MySQL is unzipped
#Remove service command: mysqld -remove

Step 6: Start the MySQL service

Method 1: Start the service command: net start mysql
Method 2:

Open the management tool service and find the MySQL service.

Start the service by right-clicking and selecting Start or directly clicking Start on the left

Step 7: Change the password of the root account

When the installation is just completed, the default password of the root account is empty. At this time, you can change the password to the specified password. For example: 123456

 c:>mysql –u root
 mysql>show databases;
 mysql>use mysql;
 mysql>UPDATE user SET password=PASSWORD("123456") WHERE user='root';
 mysql> FLUSH PRIVILEGES;
 mysql>exit

But this does not allow successful login.

Step 8: Modify the my.ini file and add the following command under [mysqld]: skip-grant-tables, then restart the mysql service

Step 9: Log in and change the root user password

c:>mysql –u root
 mysql>show databases;
 mysql>use mysql;
 mysql> UPDATE user SET authentication_string = PASSWORD('123456') WHERE user = 'root';
 mysql> FLUSH PRIVILEGES;

At this point, edit the my.ini file and delete the skip-grant-tables line, then restart MySQL. Otherwise, MySQL can still log in without a password. After success, you can log out and log in again to test whether it is successful.

Note: When using Navicat to connect to MySQL, if MySQL error number 1862 appears: your password has expired, or, in the Run window, enter the bin directory, >mysql -uroot -p123456 to log in, and then execute select * from mysql.users
The following message will be displayed: ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

Solution: MySQL> SET PASSWORD = PASSWORD('123456');

Query OK, 0 rows affected (0.03 sec)

Then select * from mysql.users and you will get the result. Navicat can also connect successfully.

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for MySQL 5.7 versions Installation tutorials for MySQL 5.6 versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 5.7.17 installation and configuration method graphic tutorial
  • mysql5.7.17.msi installation graphic tutorial
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7.17 installation and configuration graphic tutorial
  • MySQL 5.7.17 installation and configuration method graphic tutorial (windows)
  • MySQL 5.7.17 installation and configuration method graphic tutorial (CentOS7)
  • MySQL 5.7.17 winx64 installation and configuration method graphic tutorial
  • MySQL 5.7.17 installation and configuration tutorial for Mac
  • MySQL 5.7.17 installation and configuration method graphic tutorial under win7
  • MySQL 5.7.17 installation and configuration method graphic tutorial under Windows 10
  • Mysql5.7.17 winx64.zip decompression version installation and configuration graphic tutorial
  • MySQL 5.7.17 winx64 decompression version installation and configuration method graphic tutorial

<<:  Three Ways to Find the Longest Word in a String in JavaScript (Recommended)

>>:  Answer the caching principle of keep-alive components from the perspective of source code

Recommend

In-depth understanding of the seven communication methods of Vue components

Table of contents 1. props/$emit Introduction Cod...

Vue custom component implements two-way binding

Scenario: The interaction methods between parent ...

Completely uninstall MySQL database in Windows system to reinstall MySQL

1. In the control panel, uninstall all components...

In-depth explanation of the global status of WeChat applet

Preface In WeChat applet, you can use globalData ...

Docker image creation Dockerfile and commit operations

Build the image There are two main ways to build ...

An article to help you learn more about JavaScript arrays

Table of contents 1. The role of array: 2. Defini...

Detailed steps for Spring Boot packaging and uploading to Docker repository

Important note: Before studying this article, you...

Detailed explanation of CSS margin overlap and solution exploration

I recently reviewed some CSS-related knowledge po...

A brief discussion on group by in MySQL

Table of contents 1. Introduction 2. Prepare the ...

Why the explain command may modify MySQL data

If someone asked you whether running EXPLAIN on a...

Mysql command line mode access operation mysql database operation

Usage Environment In cmd mode, enter mysql --vers...

Use Rem layout to achieve adaptive

I have written an article about mobile adaptation...

MySQL scheduled task example tutorial

Preface Since MySQL 5.1.6, a very unique feature ...

Detailed explanation of custom configuration of docker official mysql image

In order to save installation time, I used the of...