The perfect solution for MYSQL5.7.24 installation without data directory and my-default.ini and service failure to start

The perfect solution for MYSQL5.7.24 installation without data directory and my-default.ini and service failure to start

MySQL official website download address: https://dev.mysql.com/downloads/mysql/

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


insert image description here

According to many online tutorials, the installation still failed, the result is:

1.Can't change dir to 'D:\from20181022\soft\mysql-5.7.24\mysql-5.7.24-winx64\data' (Errcode : 2 - No such file or directory)

2.The MySQL service is starting and the MySQL service cannot be started.


insert image description here

After trying to integrate, the final successful installation steps are as follows

1. Unzip


insert image description here

2. Create my.ini in the following directory with the following content:


insert image description here

character_set_server=utf8 #Many websites here use default-character-set=utf8, which is prone to errors port = 3306
basedir=D:\\from20181022\\soft\\mysql-5.7.24\\mysql-5.7.24-winx64
#datadir=D:\MySQL\MySQL Server 5.7.23\data You don’t need to create an empty data folder yourself max_connections=200
character-set-server=utf8
default-storage-engine=INNODB

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

3. Enter the DOS command line and use administrator to enter

a. Enter the MySQL bin directory and enter mysqld –install to install MySQL

D:\from20181022\soft\mysql-5.7.24\mysql-5.7.24-winx64\bin>mysqld -install

Service successfully installed.

b. Enter mysqld --initialize --user=root --console (initialize and create a root account. You can copy it directly)

After running...
...to the last line

[Note] A temporary password is generated for root@localhost:
OR5tM511qp_& (this is the initial password)

After initialization, you can see that there is an additional data directory under the MySQL directory

4 Start MySQL service

D:\from20181022\soft\mysql-5.7.24\mysql-5.7.24-winx64\bin>net start mysql
The MySQL service is starting.
The MySQL service has been started successfully.

5. Change password

5-1 Use the default generated password to enter mysql, command mysql -u root -p (can be copied directly)

D:\from20181022\soft\mysql-5.7.24\mysql-5.7.24-winx64\bin>mysql -u root -p
Enter password: ************

If there is a permission problem here

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Add a line to my.ini

skip-grant-tables Skip permissions for this login, delete this line after successful login

After the initial password is entered, the following will be displayed if the login is successful

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is …
Server version: …
Copyright © 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
5-2 Enter the command to change the password. I changed the default password to 123456
	mysql> set password = password('123456');

At this point, the MySQL environment under Windows has been installed.

Summarize

The above is the perfect solution for the problem that MYSQL5.7.24 is installed without a data directory and my-default.ini 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 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:
  • Detailed tutorial on compiling and installing MySQL 5.7.24 on CentOS7
  • Centos7.5 installs mysql5.7.24 binary package deployment
  • Detailed graphic description of the database installation process of MySQL version 5.7.24
  • MySQL 5.7.24 installation and configuration graphic tutorial
  • MySQL 5.7.24 installation and configuration method graphic tutorial
  • How to install mysql5.7.24 binary version on Centos 7 and how to solve it
  • Summary of installation steps and problems encountered in decompressing the mysql5.7.24 version
  • MySQL 5.7.24 compressed package installation and configuration method graphic tutorial

<<:  How to use Vue+ElementUI Tree

>>:  Summary of solving the yum error problem after upgrading Python to 3.6.6 on CentOS 7

Recommend

6 Practical Tips for TypeScript Development

Table of contents 1. Determine the entity type be...

Solution to the data asymmetry problem between MySQL and Elasticsearch

Solution to the data asymmetry problem between My...

How to use Docker Compose to implement nginx load balancing

Implement Nginx load balancing based on Docker ne...

Win10 + Ubuntu20.04 LTS dual system boot interface beautification

Effect display The built-in boot interface is too...

Detailed explanation of how to quickly build a blog website using Docker

Table of contents 1. Preparation 2. Deployment Pr...

Solve the problem of Navicat for Mysql connection error 1251 (connection failed)

Because what I wrote before was not detailed enou...

Detailed explanation of Linux tee command usage

The tee command is mainly used to output to stand...

CSS3 uses var() and calc() functions to achieve animation effects

Preview knowledge points. Animation Frames Backgr...

mysql 5.6.23 winx64.zip installation detailed tutorial

For detailed documentation on installing the comp...

How to install Maven automatically in Linux continuous integration

Unzip the Maven package tar xf apache-maven-3.5.4...

Implementation of grayscale release with Nginx and Lua

Install memcached yum install -y memcached #Start...

How to implement the King of Glory matching personnel loading page with CSS3

Those who have played King of Glory should be fam...

Detailed explanation of CSS multiple three-column adaptive layout implementation

Preface In order to follow the conventional WEB l...