A quick solution to the problem that there is no data directory and my-default.ini in the unzipped package of Windows 64-bit MySQL 5.7 or above, and the service cannot be started (problem summary)

A quick solution to the problem that there is no data directory and my-default.ini in the unzipped package of Windows 64-bit MySQL 5.7 or above, and the service cannot be started (problem summary)

I am a beginner in SQL and thought that the installation of open source was very simple, but some problems occurred in the process. I recorded them down and hope they can help others.

MySQL official website download address: https://dev.mysql.com/downloads/mysql/Click to open the link

Take version 5.7.20 as an example

First, after the installation package is unzipped, there is no data folder and my-default.ini mentioned in the online tutorial, as shown in the figure below

Please refer to the online tutorial for configuring environment variables. This is generally no problem.

Pay attention to the following points:

(1) It is not important whether the my-default.ini file exists or not. The key is to create a new my.ini file in the root directory. The specific content is as follows:

[mysql]
# Set the default character set of the mysql client to default-character-set=utf8 
[mysqld]
#Set port 3306 port = 3306 
# Set the installation directory of mysql basedir=D:\\softnew\\MYSQL\\mysql-5.7.20-winx64
# Maximum number of connections allowed max_connections=200
# The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB

You can copy and paste directly, mainly modify the path after basedir, note that the path is \\ instead of \

(2) Please do not create a data folder yourself

Many tutorials on the Internet suggest creating a new empty data folder and then adding a sentence to the my.ini file:

# Set the storage directory of mysql database data datadir=D:\\softnew\\MYSQL\\mysql-5.7.20-winx64\\data

This will cause the service to fail to start. Do not add this sentence, and do not create a new data folder yourself. Let mysql automatically generate data. Specifically:

Open the cmd command window and go to the bin directory of the MySQL installation directory. Then enter the command mysqld install to display success

Then enter: mysqld --initialize There should be no prompt at this time

Then enter:

net start mysql shows

Finally, the contents of the data folder should be displayed as follows:

Summarize

The above is the quick solution introduced by the editor for the problem that there is no data directory and my-default.ini in the unzipped package of Windows 64-bit MySQL 5.7 or above, and the service cannot be started. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor 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:
  • Mysql5.7 my.ini file loading path and data location modification method under windows7
  • Detailed tutorial for installing mysql5.7.21 under Windows
  • Detailed tutorial for installing mysql5.7.21 under Windows system
  • MySQL 5.7.21 installation and configuration method graphic tutorial (window)
  • Tutorial on downloading, installing, configuring and using MySQL under Windows
  • Using MySQL in Windows: Implementing Automatic Scheduled Backups
  • Solution to the problem that MySQL in Windows system cannot input and display Chinese

<<:  CentOS uses local yum source to build LAMP environment graphic tutorial

>>:  How to make your own native JavaScript router

Recommend

CSS3 sample code to achieve element arc motion

How to use CSS to control the arc movement of ele...

Example code for implementing raindrop animation effect with CSS

Glass Windows What we are going to achieve today ...

How to build a MySQL PXC cluster

Table of contents 1. Introduction to PXC 1.1 Intr...

Four modes of Oracle opening and closing

>1 Start the database In the cmd command windo...

Analysis of the event loop mechanism of js

Preface As we all know, JavaScript is single-thre...

Complete steps for vue dynamic binding icons

0 Differences between icons and images Icons are ...

What are the core modules of node.js

Table of contents Global Object Global objects an...

WeChat applet implements a simple handwritten signature component

Table of contents background: need: Effect 1. Ide...

How to ensure transaction characteristics of MySQL InnoDB?

Preface If someone asks you "What are the ch...

HTML basics - CSS style sheets, style attributes, format and layout details

1. position : fixed Locked position (relative to ...