Solve the problem that Mysql5.7.17 fails to install and start under Windows

Solve the problem that Mysql5.7.17 fails to install and start under Windows

Install MySQL for the first time on your machine.

The operating system is win7

The installation file of mysql is in zip format and the version is 5.7.17

After decompression, the installation steps are

1. First, find a file to store these installation programs and data

Assume it is E:\\mysql

2. Put the unzipped files in E:\\mysql and create a new data folder

3. Create the environment variable mysql path is E:\\mysql

Add to path %MYSQL%\bin;

4. There is a my-default.ini in the unzipped folder.

First, make a copy of the file and rename it to my.ini

Modify file contents

Just modify two lines

basedir = E:\\mysql 
datadir = E:\\mysql\\data

These two lines were originally commented out with #.

5. Start the command line as a system administrator

Type mysqld -install

This is to install the mysql service

6. Enter mysqld --initialize

This is because after version 5.7.7, the Windows installation of MySQL through zip decompression no longer contains the data folder. You can refer to the introduction on the official website for this.

http://dev.mysql.com/doc/refman/5.7/en/windows-initialize-data-directory.html

If there is no data folder, the MySQL service will not start when it is started. You can find some errors by observing the files with the suffix .err in the data folder.

MySQL: Table 'mysql.plugin' doesn't exist 
2017-01-01T17:13:33.200113Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
2017-01-01T17:13:33.202113Z 0 [Note] Salting uuid generator variables, current_pid: 6908, server_start_time: 1483290810, bytes_sent: 0,  
2017-01-01T17:13:33.237115Z 0 [Note] Generated uuid: '9fb87162-d045-11e6-b092-00ff173a9c42', server_start_time: 1483297718, bytes_sent: 114009376 
2017-01-01T17:13:33.241115Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 9fb87162-d045-11e6-b092-00ff173a9c42. 
2017-01-01T17:13:33.248116Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 
2017-01-01T17:13:33.250116Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key 
2017-01-01T17:13:33.254116Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 
2017-01-01T17:13:33.259116Z 0 [Note] IPv6 is available. 
2017-01-01T17:13:33.260117Z 0 [Note] - '::' resolves to '::'; 
2017-01-01T17:13:33.261117Z 0 [Note] Server socket created on IP: '::'. 
2017-01-01T17:13:33.266117Z 0 [Warning] Failed to open optimizer cost constant tables 
2017-01-01T17:13:33.268117Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 
2017-01-01T17:13:33.270117Z 0 [ERROR] Aborting

In fact, this is because these are placed in the data folder, so we need to execute the command mysqld -initialize to complete the initialization of mysql. In this way, mysql will automatically complete some initialization work.

7. Start the service net start mysql

The above is what I introduced to you about how to solve the problem of unsuccessful installation and startup of Mysql5.7.17 under Windows. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7 installation tutorial (windows)
  • Graphic tutorial on how to modify the initial password of Mysql5.7.11 under Windows
  • Comprehensive analysis of the method of installing mysql5.7 under Windows
  • mysql5.7.13.zip installation tutorial (windows)

<<:  Detailed explanation of the use of redux in native WeChat applet development

>>:  How to use the Linux more command in Linux common commands

Recommend

HTML Learning Notes--Detailed Explanation of HTML Syntax (Must Read)

1. What is HTML markup language? HTML is a markup...

MySql Group By implements grouping of multiple fields

In daily development tasks, we often use MYSQL...

How to use .htaccess to prohibit a certain IP from accessing the website

Preface For cost considerations, most webmasters ...

jQuery realizes the scrolling effect of table row data

This article example shares the specific code of ...

Win10 uses Tsinghua source to quickly install pytorch-GPU version (recommended)

Check whether your cuda is installed Type in the ...

Review of the best web design works in 2012 [Part 1]

At the beginning of the new year, I would like to...

How to install JDK 13 in Linux environment using compressed package

What is JDK? Well, if you don't know this que...

How to use selenium+testng to realize web automation in docker

Preface After a long time of reading various mate...

Detailed explanation of WeChat Mini Program official face verification

The mini program collected user personal informat...

Example of how to exit the loop in Array.forEach in js

Table of contents forEach() Method How to jump ou...

How to change the dot in the WeChat applet swiper-dot into a slider

Table of contents background Target Effect Ideas ...

Some questions about hyperlinks

<br />I am very happy to participate in this...

Navicat Premium operates MySQL database (executes sql statements)

1. Introduction to Navicat 1. What is Navicat? Na...