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

CSS Viewport Units for Fast Layout

CSS Viewport units have been around for the past ...

mysql-8.0.17-winx64 deployment method

1. Download mysql-8.0.17-winx64 from the official...

Detailed code examples of seven methods for vertical centering with CSS

When we edit a layout, we usually use horizontal ...

Teach you how to write maintainable JS code

Table of contents What is maintainable code? Code...

Nginx restricts IP access to certain pages

1. To prohibit all IP addresses from accessing th...

What you need to know about msyql transaction isolation

What is a transaction? A transaction is a logical...

A comparison between the href attribute and onclick event of the a tag

First of all, let's talk about the execution ...

Docker container log analysis

View container logs First, use docker run -it --r...

Tutorial on installing MySQL8 compressed package version on Win10

1 Download MySQL8 from the official website and i...

Vue application example code based on axios request encapsulation

Table of contents What is axios? Axios request ty...

Detailed explanation of the basic usage of SSH's ssh-keygen command

SSH public key authentication is one of the SSH a...

MySQL transaction isolation level details

serializable serialization (no problem) Transacti...