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

Use Vue3 for data binding and display list data

Table of contents 1. Comparison with Vue2 1. New ...

How to customize at and cron scheduled tasks in Linux

There are two types of scheduled tasks in Linux s...

Sharing of web color contrast and harmony techniques

Color contrast and harmony In contrasting conditi...

Mysql dynamically updates the database script example explanation

The specific upgrade script is as follows: Dynami...

How to install openssh from source code in centos 7

Environment: CentOS 7.1.1503 Minimum Installation...

A detailed summary of HTML tag nesting rules suitable for beginners

I have been relearning HTML recently, which can be...

A brief discussion on the optimization of MySQL paging for billions of data

Table of contents background analyze Data simulat...

Detailed tutorial for installing mysql5.7.21 under Windows

This article shares the installation tutorial of ...

HTML basics HTML structure

What is an HTML file? HTML stands for Hyper Text M...

How to install and deploy gitlab server on centos7

I am using centos 7 64bit system here. I have tri...

JavaScript operation element examples

For more information about operating elements, pl...

Steps to install MySQL 5.7.10 on Windows server 2008 r2

Install using the MSI installation package Downlo...