Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Perfect solution for MYSQL5.7.24 installation without data directory and my-default.ini and services cannot be started

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Download address of mysql official website: https://dev.mysql.com/downloads/mysql/

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

According to many tutorials online, the installation is still unsuccessful, as a result:

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)

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

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

1. Decompression

two。 Create a my.ini in the following directory, as follows:

Character_set_server=utf8 # there are a lot of default-character-set=utf8 on the Internet here. Error prone port = 3306basedir=D:\\ from20181022\\ soft\\ mysql-5.7.24\\ mysql-5.7.24-winx64#datadir=D:\ MySQL\ MySQL Server 5.7.23\ data there is no need to create an empty data folder max_connections=200character-set-server=utf8default-storage-engine=INNODB by yourself here

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

3. Enter the command line of dos and use administrator to enter

a. Enter the bin directory of MySQL and type 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. Can be copied directly)

After operation

...

... 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 are more data directories in the MySQL directory.

4 start the 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 started successfully.

5. Change the password

5-1 enter mysql using the default generated password and 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 skips permissions for login this time, and deletes this line after successful login

After the initial password is entered, a successful login displays the following

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 itsaffiliates. Other names may be trademarks of their respectiveowners.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 is already installed.

Summary

The above is the perfect solution that the editor introduces to you that the MYSQL5.7.24 installation can not be started without data directory and my-default.ini. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report