windows10 under Mysql5.7 Installation Guide

background

On the occasion of the 70th anniversary of National Day, in order to carry forward the majority of domestic software development industry, I decided to use MySQL5.7.
Pooh! The reality is that the company's project using a Mysql5.7, but the official server in a foreign country, but also a test server in a foreign country, the key problem is that my development is domestic, so I started a project is likely to error: Database connection error / MongoDB connection error / Redis connection error / MQ connection error, then I have to build a set of their own. In fact, I have a set of environmental else, but my Mysql is 8.0, so the production and development with the environment is not the same. So I just installed Mysql5.7 2 on my little HP shadow elves. (Yes, I have a Mysql5.6 installation, Mysql5.7 and Mysql8.0 on this notebook, ports are 3306,3307,3308)

Installation Environment

Windows version: Windows 10 1903
the CPU model: I5-6300HQ
Memory: 16G
MySQL version: MySQL 5.7.27

Download and install

  1. Click to download Mysql , click on the page the Looking for GA Previous versions? ;
  2. Select Mysql5.7 latest version (as of 2019-09-24, version 5.7.27), select 64 ZIP download ;
  3. Find the bottom of the "No thanks, just start my download .", And then start the download. (Why I want to write a three-step, rather than directly to you the download link it after yourself because you will not download the new version of the ah?.);
  4. The next step is the easiest extract the zip, and the archive down under your installation directory (My list is: D: \ developer \ MySQL \ mysql-5.7.27-winx64);
  5. Right lower left corner of "windows start menu", select "Command Prompt (Administrator)", type cd /d D:\developer\MySQL\mysql-5.7.27-winx64\bin(here is bin directory after you unpack the Mysql directory, of course, some compression software will extract more than one directory, himself modify as appropriate), mysqld install mysql5.7(installation service name, if your computer has no other msyql installed, the direct use mysqld installcan also be equivalent mysqld install mysql);

Initialize the database

This step is where to install Mysql5.7 above and the focus.

  1. MySQL directory to enter decompression
  2. If you just installed a version of Mysql, and what the port does not change, then skip to step 4, otherwise skip to step 3;
  3. New my.ini, add the following ( do not write other things, otherwise it will error! Remember Remember! Up to change the port number. ) :( In the middle period of two long lines # sign)
    ##### #########################################
    [client]
    # client access port
    port = 3307

    [MySQL]
    #mysql default encoding
    default-character-set = utf8mb4

    [mysqld]
    # Port
    Port = 3307
    # closed automatically updated update fields in the column of type TIMESTAMP field
    explicit_defaults_for_timestamp. 1 =
    # table names are case sensitive the windows must be at 2 / Linux is 0
    lower_case_table_names 2 =
    ####### #######################################

  4. Right lower left corner of "windows start menu", select "Command Prompt (Administrator)", type cd /d D:\developer\MySQL\mysql-5.7.27-winx64\bin(bin directory under decompression after Mysql directory), enter mysqld --initialize-insecurethis way will be able to generate a non-root user password of the.

Start mysql

  1. Right lower left corner of "windows start menu", select "Command Prompt (Administrator)", type net start mysql5.7(if you did not write mysql5.7 is the default, then net start mysql, is, and download and install Step 5 services installed last name has been on the line )
  2. Enter cmd mysql -P 3307 -uroot -p(if you initialize the database does not perform step 3, then the input mysql -uroot -p), and then press Enter on the line, because there is no password;
  3. create password:update mysql.user set authentication_string=password('123qwe') where user='root' and Host ='localhost';
  4. You can open the back of your use of the Mysql5.7.

End

Hopefully this article will help you install Mysql5.7 and distressed!

Reference article

Mysql5.7.20 not start the problem: https://blog.csdn.net/malinda666/article/details/78929428
Mysql Mysql official extract the installation documentation: https://dev.mysql.com/doc/refman/5.7/en/windows archive.html--install
Mysql official initialization data: https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html

Guess you like

Origin www.cnblogs.com/Lenbrother/p/11572770.html
Recommended