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

Linux Dig command usage

Dig Introduction: Dig is a tool that queries DNS ...

Website Building Tutorial for Beginners: Learn to Build a Website in Ten Days

The 10-day tutorial uses the most understandable ...

Summary of MySQL lock related knowledge

Locks in MySQL Locks are a means to resolve resou...

Improvement experience and sharing of 163 mailbox login box interactive design

I saw in the LOFTER competition that it was mentio...

Tutorial on migrating mysql from phpstudy to Linux

Project Purpose Migrate the data in MySQL 5.5.53 ...

Introduction to MySQL Connection Control Plugin

Table of contents 1. Introduction to the connecti...

Will the index be used in the MySQL query condition?

When an employer asks you whether an index will b...

Detailed explanation of the code for implementing linear gradients with CSS3

Preface The gradient of the old version of the br...

Detailed explanation of mysql filtering replication ideas

Table of contents mysql filtered replication Impl...

Mysql 5.7.18 Using MySQL proxies_priv to implement similar user group management

Use MySQL proxies_priv (simulated role) to implem...

How to use the dig/nslookup command to view DNS resolution steps

dig - DNS lookup utility When a domain name acces...

How to customize an EventEmitter in node.js

Table of contents Preface 1. What is 2. How to us...

Tutorial for installing MySQL 8.0.18 under Windows (Community Edition)

This article briefly introduces how to install My...