MySQL 5.7.27 detailed download, installation and configuration tutorial-to solve the problem of MSVCR120.dll

mysql installation problem: The code cannot be executed because MSVCR120.dll cannot be found. Reinstalling the program may solve this problem.

Installation: Microsoft Common Runtime Library Collection 2020-> https://baoku.360.cn/soft/search?kw=%E5%BE%AE%E8%BD%AF%E5%B8%B8%E7%94%A8 %E8%BF%90%E8%A1%8C%E5%BA%93%E5%90%88%E9%9B%86

Preface

There are many problems when installing MySQL. There are many ways to solve the problems on the blog. Here I attach some links. Friends who encounter problems can read and refer to it. This article is mainly for those who are new to the database. To install the MySQL database. At present, the MySQL versions on the official website are 5.5, 5.6, 5.7 and 8. When developing, we generally choose one or two versions lower than the latest version, so I chose 5.7 as the database to be installed.

1. Download steps

  1. Visit the official website: https://www.mysql.com/
    select Community under Downloads
    Insert picture description here
  2. Download the corresponding version
    Click on the MySQL Community Server in the figure above to enter the download interface:
    Insert picture description herefind the link of MySQL Community Server 5.7 , click to enter:
    Insert picture description herechoose to download the corresponding ZIP file according to the version of your computer , my computer is 64-bit, so choose To download this item, click Download to enter the following interface:
    Insert picture description hereClick No thanks, just start my download , and then start
    Insert picture description heredownloading. After the download is complete, unzip the file to the disk and directory you want to save. I extracted the file to the E:\Program Files\Mysql directory.
    Insert picture description here
    All the work of downloading is completed above.

2. Configure environment variables

  1. System— >Advanced System Settings—>Environment Variables—>System Variables
    Insert picture description hereInsert picture description hereInsert picture description hereclick New , the variable name is: MYSQL_HOME , add the location of your mysql-5.7.27-winx64 folder.
    Mine is in E:\Program Files\Mysql\mysql-5.7.27-winx64 , as shown in the figure:
    Insert picture description here
  2. Edit Path and copy it ;%MYSQL_HOME%\binto the back of the original value, as shown in the figure:
    Insert picture description here

3. Configure the my.ini file

Create a new my.ini file in your mysql-5.7.27-winx64 directory. Mine is in the E:\Program Files\Mysql\mysql-5.7.27-winx64 directory. The content of the my.ini file is:

[mysqld]
#端口号
port = 3306
#mysql-5.7.27-winx64的路径
basedir=E:\Program Files\Mysql\mysql-5.7.27-winx64
#mysql-5.7.27-winx64的路径+\data
datadir=E:\Program Files\Mysql\mysql-5.7.27-winx64\data 
#最大连接数
max_connections=200
#编码
character-set-server=utf8

default-storage-engine=INNODB

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysql]
#编码
default-character-set=utf8 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

Insert picture description here
After the creation is complete, go to the next step.

4. Install MySQL

1. Enter cmd in the input box and run it as an administrator . Note that it must be run as an administrator , otherwise there will be Install/Remove of the Service Denied due to insufficient management authority during the installation process ! (Installation/uninstallation service rejected) , this is very important!
Insert picture description here

  1. Enter the E:\Program Files\Mysql\mysql-5.7.27-winx64\bin directory in cmd : enter the installation command:, if Service successfully installed appears , the installation is successful; if Install of the Service Denied appears , it means Run cmd without administrator privileges: then continue to enter the command:, there will be no prompt at this time: enter the start command: again , and the following prompt appears to prove that MySQL started successfully:
    Insert picture description heremysqld -install
    Insert picture description here
    mysqld --initialize
    Insert picture description here
    net start mysql
    Insert picture description here

5. Set MySQL password

1. The main purpose of setting the password here is to solve the problem: ERROR 1045 (28000): Access denied for user'root'@'localhost' (using password: NO)
2. First stop the MySQL service and enter the command line net stop mysql:
Insert picture description here
3. In Find my.ini in the E:\Program Files\Mysql\mysql-5.7.27-winx64 directory, add any line under the [mysqld] field skip-grant-tables, and save it: Insert picture description here
4. Restart MySQL and enter the startup command:, the net start mysqlfollowing prompt appears MySQL started successfully:
Insert picture description here
When you enter the command mysql -u root -p, you do not need to enter a password, just press Enter:
Insert picture description hereEnter MySQL successfully! Haha, it should be worthwhile to be happy after this step!
5. Enter the command line use mysqlto enter the database:
Insert picture description here
6. Enter the command line update user set authentication_string=password("xxxxxx") where user="root";xxxxxx is the new password you set, if the following message appears after hitting enter, the modification is successful!
Insert picture description here
7. Manually stop the MySQL service, enter the service in the win10 search bar , and find MySQL . Right-click, and then click Stop.
Insert picture description hereThen delete the skip-grant-tables line in the my.ini file just now , save and close.
8. Start cmd (administrator status) again, enter the start command:, net start mysqlenter mysql -u root -pagain, and enter the password you just set. The following message appears to prove that the setting is successful!
Insert picture description hereThen enter the command line to use mysqlverify it, and the result is an error:
Insert picture description hereSince there is no reset password, then reset it.
Type the command line. alter user user() identified by "xxxxxx";My password is 123456, so I typed  alter user user() identified by "123456";Enter! Getting closer and closer to victory!
Enter the command line again to use mysqlverify it, success!
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_29752857/article/details/112118393